Skip to main content
Inspiring
January 15, 2020
Question

Load selected file(s) to placeGun

  • January 15, 2020
  • 1 reply
  • 649 views

Hi,
in my workflow would by nice to load selected file to placeGun without open dialog window. Same as drag and drop but without drag and drop 🙂 
So i know i can get filepath to clipboard with CTRL+C (windows 10)

 

mySelectedFile = //but i dont know how to tel JS: use filepath wich is in my clipboard. (because i cant use specific filepath - somethimes i need this for 200 files, one by one, (snippets))
app.activeDocument.placeGuns.loadPlaceGun(mySelectedFile);

 

I know JS have som restriction with Clipboard, so, it is possible do this via JS ?
Thank you

This topic has been closed for replies.

1 reply

brian_p_dts
Community Expert
Community Expert
January 15, 2020

Quick and dirty way would be to create a text frame, paste the contents in there, get the contents as a variable, then delete the text frame. There are a couple solutions here: https://gist.github.com/grefel/f1424c3a73f34e75b789

zuzu_kuc1Author
Inspiring
January 15, 2020

Hmmm, another solution may be combine this with Autohotkey. Write filepath directly in to javascript file and then run script.