I like to open custom URLs, such as "myscheme://a/b/c" from my AppleScript code.
This is not about opening http URLs in a web browser. This is about getting the same result as when you create an .inetloc file in the Finder and then open that file in the Finder, or invoking this code in a macOS app written in ObjC:
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString: @"myscheme://a/b/c"]];
Best Answer
If
myscheme
is properly registered in the Launch Services Database to open a particular application, then you can use theopen location
command, which: "Opens a URL with the appropriate program."Use as in the following examples:
Or directly:
Have a look at the AppleScript Language Guide and more specifically, the
open location
command.