Copy link to clipboard
Copied
Hi everyone,
I'm trying to find some sort of documentation for using URL Schemes for lightroom, I know it takes links like <a href="lightroom://foo"></a> and opens it, but I was wondering which actions can you pass?
Thank you.
Copy link to clipboard
Copied
You can pass any parameters you like, lightroom://yourpluginidentifier/string
Here's how to use it: http://forums.adobe.com/message/3276842
Copy link to clipboard
Copied
To further jarnoh's response:
'lightroom://'
tells the OS to send url to Lr app (Lr is registered protocol handler).
'yourpluginidentifier'
tells Lr which plugin to send url to.
'string'
no further parsing is done - i.e. you can emulate CGI or roll-yer-own whatever...
in other words, the 'string' is yours to do with as you see fit - neither OS nor Lr will try to help nor interfere...
Rob
Copy link to clipboard
Copied
Thanks for your responses, really helpful.
Copy link to clipboard
Copied
You bet, but note, it is theoretically possible for the url to come wrapped in quotes (dunno where I got this notion, or if/when it ever happens even..). Here's the contents of one of my URL handling files:
return {
URLHandler = function(url)
if url:sub( 1, 1 ) == '"' then -- double-quote wrapped format.
cookmarks:urlHandler( url:sub( 2, -2 ) ) -- strip double-quotes.
else
cookmarks:urlHandler( url )
end
end
}
Copy link to clipboard
Copied
The thread Jarnoh linked to included a post about the double quote issue. I have seen it happen on occassions so you do need to check for it - at least in LR 3 and LR 4.
I thought the URLHandler was documented in the LR 4 API Guide PDF (need to double check). If not Jeffrey Friedl posted about it some time ago and included enough information to know how to use it.
Matt.
Copy link to clipboard
Copied
Hi,
Thanks for the help. We are trying to open folder containing raw files with Lightroom by the help of our Lightroom Plugin.
We are able to open lightroom using lightroom://, what would be your suggestion in opening the folder inside lightroom. Is their function in the SDK that can help in Importing Photos.
Any help would be appreciated.
Copy link to clipboard
Copied
"We are trying to open folder containing raw files with Lightroom by the help of our Lightroom Plugin.
We are able to open lightroom using lightroom://, what would be your suggestion in opening the folder inside lightroom. Is their function in the SDK that can help in Importing Photos."
The method catalog:addPhoto() will import a photo into the catalog. (See the documentation for LrCatalog).
The method catalog:setActiveSources() can change the currently selected source displayed to the user to the given folder or collection.
[Use the blue reply button under the first post to ensure replies sort properly.]