Copy link to clipboard
Copied
On the PC, this launches a file phoPath in that file type's default application - eg a NEF opens directly in Capture NX if it is the Windows default for NEF files:
LrTasks.execute('"' .. phoPath .. '"')
But it doesn't seem to work on Mac. LrShell.openFilesInApp is no use here because it needs the name of the target application, which I don't want to hard code (because the user may have set some other app as the default).
Any thoughts? Can the SDK determine the Mac OS's default application for a file type? Or is there a way to get LrTasks to do the job?
John
Copy link to clipboard
Copied
You probably want to use the open command on Mac. It will look up the user-selected app for the files you're opening and launch it accordingly.
Type man open on the command line for details.
Copy link to clipboard
Copied
Also, be aware that the Windows shell has some really wacky character escaping rules.
LrTasks.execute('"' .. phoPath .. '"')
will probably fail for file names that contain certain special characters.
I've posted sample code here for working around this wackiness on the forums before. Don't have the link handy at the moment, but I think you would find it if you search the forum for LrTasks.execute.
Copy link to clipboard
Copied
Thanks Eric, that should help.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now