Hi,
I'm trying to launch BBEdit from one of my apps. The relevant code looks
like this:
- (void)openWithEditor:(NSString *)path atLine:(NSInteger)line {
NSWorkspace *sws = NSWorkspace.sharedWorkspace;
// construct BBEdit URL
NSString *encodedPath = [path
stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet];
NSString *uri = [@"x-bbedit://open?url=file://"
stringByAppendingString:encodedPath];
if (line != NSNotFound) {
uri = [uri stringByAppendingFormat:@"&line=%li", line];
}
NSURL *bbedit = [NSURL URLWithString:uri];
if ([sws openURL:bbedit]) {
my_os_log_debug("Using BBEdit.");
} else {
// use TextEdit instead
[sws openFile:path withApplication:@"TextEdit"];
}
}
If BBEdit is already running, even without any file currently open,
everything works fine.
If BBEdit is not runnning however, application error code: 100001 will pop
up.
I have allowed Full Disk Access, but that didn't change anything.
macOS 10.14.6.
Any help is appreciated,
-Udo.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or need technical support, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/bbedit/0ac8e991-062e-4f35-a2a8-b2fa2e924aa8%40googlegroups.com.