Script to use link name in search URL
I have noe experience with javascript but would like to create a script for Indesign that would get the link file name of the selection apply some GREP to the result, grabbing part of the link name, then use the result in a search URL which would open in the browser.
Example
With a frame selected in Indesign with an image inside with example file name below 1234567_00000000000000.jpg fileName
I think the below javascript will grab the file name but I dont know how to use this into a variable.
app.selection[0].graphics[0].itemLink.name;
Then use the below GREP to grab the first 7 digitits
\<\d\d\d\d\d\d\d fileName7
and pass that into a search URL and open in a browser
https://website.pretend.com/UserSearchResult.php/media_search%5BsSimpleSearchString%5D=fileName7&media=simple
Is any one able to help turn this into a Indesign javascript?
