Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Creating a desktop droplet for an InDesign script

Explorer ,
Sep 13, 2022 Sep 13, 2022

I have an often used script that I would like to create a button or droplet for. What would be the best way to do this? Applescript or is there some other method? Any tips would be greatly appreciated!

TOPICS
How to , Scripting
664
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 13, 2022 Sep 13, 2022

Hi @michaelr26894937 , Also, to create an AppleScript droplet for ID, wrap the code in on open ... end open statements, use the Finder to get a list of dropped files, and a repeat loop to call the code you want to run in ID. Here’s a template that opens the dropped ID file, and displays its name

 

 

on open
	tell application "Finder"
		activate
		set the sel to the selection
		repeat with x in sel
			set thePath to (x as Unicode text)
			tell application id "com.adobe.indesign"
				--InDesign co
...
Translate
People's Champ ,
Sep 13, 2022 Sep 13, 2022

Applescript for sure. You can indeed save your applescript script as a droplet. It's too old since I last done sth like that but it's surely doable.

https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomatio...

then the InDesign code is nothing special.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 13, 2022 Sep 13, 2022

Hi @michaelr26894937 , Also, to create an AppleScript droplet for ID, wrap the code in on open ... end open statements, use the Finder to get a list of dropped files, and a repeat loop to call the code you want to run in ID. Here’s a template that opens the dropped ID file, and displays its name

 

 

on open
	tell application "Finder"
		activate
		set the sel to the selection
		repeat with x in sel
			set thePath to (x as Unicode text)
			tell application id "com.adobe.indesign"
				--InDesign code here
				activate
				open thePath
				display dialog "Name: " & name of active document
			end tell
		end repeat
	end tell
end open

 

 

You have to compile and save the code as an app and then give the app permission to run, either through the dialog that will pop up on the first run or via the OS Security and Privacy Accessibility preferences:

 

Screen Shot 13.pngScreen Shot 14.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 13, 2022 Sep 13, 2022

Thanks! By "--InDesign code here", do you mean I place the contents of the jsx file there?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 13, 2022 Sep 13, 2022
LATEST

No I meant AppleScript code. There is a AppleScript do script command that will run or open JavaScript code. How complex is the JavaScript?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines