Search code examples
macosshellcurlapplescriptlightroom

Call custom URI Scheme (eg lightroom://myplugin... ) from shell / terminal / AppleScript instead of web browser on OS X


Adobe Lightroom uses its own URI scheme: lightroom://myplugin.details/command to send messages to installed plugins.

I'm trying to trigger these from OS X (specifically from AppleScript in my case). I can do this by telling Safari or Firefox to open the url "lightroom://...." which works. However, I'm sending hundreds of these commands and the tabs are getting unmanageable.

It would be much better to send this in the background, eg via a shell script or curl, but curl does not understand lightroom:// links, and so I'm not sure how do to this.

I don't need to get any response back, just trigger the link.


Solution

  • Standard Additions in AppleScript contains the command

    open location (verb): Opens a URL with the appropriate program (from Internet Suite, defined in StandardAdditions.osax)

    for example

    open location "lightroom://myplugin.details/command"
    

    without any application tell block.