application error code: 100001

21 views
Skip to first unread message

Udo Thiel

unread,
Nov 25, 2019, 9:39:24 AM11/25/19
to BBEdit Talk
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.
Reply all
Reply to author
Forward
0 new messages