-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it work for Indesign? #1
Comments
The scripts scope is now at I tried accessing them directly from: |
The script relies on the applications ability to open a script file via similar to how you'd open any file via I think it should be possible. Quick googling says Indesign tell application "Adobe InDesign 2020"
activate
set jsx_script to "...Desktop:HelloWorld.jsx"
set a to "Foo"
set b to "Bar"
set my_values to {a, b}
do script jsx_script language javascript with arguments my_values
end tell For the purpose of this workflow you'd pretty much have to replace the part on the current workflow Applescript that says I'll take a look at it this weekend, if I have time. Though not to get your hopes up too much, I did see a lot of people complaining about it not working in few of the more recent Marcos versions. |
Thanks for your quick reply! I changed the AS script to:
No error notification anymore but nothing happens in InDesign either. Thanks for now! |
I will take a proper look sooner or later, but if I were to play around with it, I would take the simplest example of tell application "Adobe InDesign 2023"
set jsx_script to "/Users/joonaspaakko/Dropbox/Adobe scripts/Indesign/MultiPageImporter2.5-CS5.jsx"
do script jsx_script language javascript
end tell
I'd guess it would have to be something like this:
on run argv
set appName to (system attribute "targetApplication") --Alfred variable
set frontMostVar to (system attribute "frontMost") --Alfred variable
set scriptFile to POSIX file (item 1 of argv)
set isIndesign to appName is "Adobe Indesign"
tell application "System Events"
set targetApp to application file of (first application process whose name contains appName)
set appPath to path of targetApp
set appName to name of targetApp
end tell
if frontMostVar is "true" then
if application appName is frontmost then
if isIndesign then
tell application appName
do script scriptFile language javascript
end tell
else
tell application "Finder"
open scriptFile using appPath
end tell
end if
end if
else
if isIndesign then
tell application appName
do script scriptFile language javascript
end tell
else
tell application "Finder"
open scriptFile using appPath
end tell
end if
end if
end run Here's what I changed from the original: on run argv
set appName to (system attribute "targetApplication") --Alfred variable
set frontMostVar to (system attribute "frontMost") --Alfred variable
set scriptFile to POSIX file (item 1 of argv)
+ set isIndesign to appName is "Adobe Indesign"
tell application "System Events"
set targetApp to application file of (first application process whose name contains appName)
set appPath to path of targetApp
set appName to name of targetApp
end tell
if frontMostVar is "true" then
if application appName is frontmost then
+ if isIndesign then
+ tell application appName
+ do script scriptFile language javascript
+ end tell
+ else
tell application "Finder"
open scriptFile using appPath
end tell
+ end if
end if
else
+ if isIndesign then
+ tell application appName
+ do script scriptFile language javascript
+ end tell
+ else
tell application "Finder"
open scriptFile using appPath
end tell
+ end if
end if
end run |
Thanks for taking the time to point me out with your feedback! Activating a fixed script directly is no problem and works, also from Alfred (in the simple code version, see attached workflow with keyword 'idl'). But when I try to combine this in your workflow it still doesn’t execute/activates the scripts (even with the fixed path to a script). So I've tried:
|
I updated the repo with a new workflow file where the Indesign script launching seems to now be working fine. The issue with my untested code was that apparently application specific methods like the
|
Thanks for taking the time trying to fix this. Only I can't get this to work, also the AI and PS part doesn't work anymore in this new workflow. I granted access in the automation part in security and privacy tab in system preferences. See picture below. The old workflow for only PS and AI still works fine, i'm getting the scripts out of the same scope. Any idea what i could be missing? This is the outcome of the debugger:
|
I updated the workflow file again. I split the AppleScript action so that Indesign uses its own. If it still doesn't work, it won't affect AI and PS. I switched from the bundle id to the static application name string, which should now work, but requires manual updating every year when your Indesign updates.
|
I found the solution to still use the bundle id, which is of course better. Place 'id' after 'tell application'
When InDesign script is launched it still says Photoshop scripts, i can fix this myself but you probably want to update your workflow here. Thanks for your help, great to launch InDesign scripts this way! |
Good, I was pretty crushed when I thought I had to use a static string. I updated the repo with your suggested fixes. |
Hi,
First, thanks for this really handy workflow!
The workflow returns an error trying to make it work for InDesign. Only the last part when executing the script returns an error, the rest works fine the same as the AI and PS part. Do you know how to modify it to make it work the same way for InDesign?
It now produces this error, see below:
I'm guessing InDesign handles the scripts differently? The scripts all work when used directly from InDesign, so they seem to be fine.
Hope you can help?
The text was updated successfully, but these errors were encountered: