Copy link to clipboard
Copied
Hello. I have an often used script that I would like to create a droplet for on my desktop. I am hoping to be able to simply drag an InDesign Document to the droplet, the Document opens in InDesign and the script runs.
I am not really familiar with Applescript, but I tried this code and saved as an app
-----
on open droppeditems
tell application "Finder"
activate
tell application "Adobe InDesign 2022"
activate
set mydocument to droppeditems
set aScriptPath to "Users:rosami:Library:Preferences:Adobe InDesign:Version 17.0:en_US:Scripts:Scripts Panel:batch_convert.jsx"
do script alias aScriptPath language javascript
end tell
end tell
end open
------
When I drag the Doc to the droplet, it opens InDesign and the Script, but not the Document. Any suggestions as to what I am doing wrong? Thank you!
You have to open the dropped items in order to run the script—your mydocument variable isn’t doing anything. Try this:
on open
tell application "Finder"
activate
--gets the dropped item(s)
set the sel to the selection
repeat with x in sel
set thePath to (x as Unicode text)
tell application id "com.adobe.indesign"
activate
--opens each dropped item and runs the jsx
open thePath
set aScriptPath to "Users:rosami:Library:Preferences:Adobe InDesign:Version 17.0:
...
Copy link to clipboard
Copied
Hi @michaelr26894937 , can you post the JavaScript you are trying to run?
Copy link to clipboard
Copied
Hi Rob, It's the batch process script. It's quite long but I will post shortly.
Copy link to clipboard
Copied
You have to open the dropped items in order to run the script—your mydocument variable isn’t doing anything. Try this:
on open
tell application "Finder"
activate
--gets the dropped item(s)
set the sel to the selection
repeat with x in sel
set thePath to (x as Unicode text)
tell application id "com.adobe.indesign"
activate
--opens each dropped item and runs the jsx
open thePath
set aScriptPath to "Users:rosami:Library:Preferences:Adobe InDesign:Version 17.0:en_US:Scripts:Scripts Panel:batch_convert.jsx" as alias
do script aScriptPath language javascript
end tell
end repeat
end tell
end open
EDIT: Fixed a typo in the do script line after posting