Copy link to clipboard
Copied
I am getting errors on applescripts that worked on High Sierra and Mojave.
As an example the simple script below works just fine on High Sierra and Mojave but fails with this error on both ID CC 2018 and 2020.
"Missing required parameter 'file name' for method 'place'." number 30479"
Has anyone ever seen this error after upgrading to Catalina and do they have a solution. I have a inherited a massive automated catalog building application so "just use javascript" is not an option.
set myfile to choose file
tell application "Adobe InDesign 2020"
tell document 1
set pageSnippetpath to "Catalog_Builder_XML:Support_Files_CC2015:Contract Catalog:Snippets:2hl.inds"
place file (pageSnippetpath as string) on page 1
end tell
end tell
Copy link to clipboard
Copied
Correction on the sample script included above. Don't need the first line since I am setting the path as a string. I am still getting the error.
set myfile to choose file
tell application "Adobe InDesign 2020"
tell document 1
set pageSnippetpath to "Catalog_Builder_XML:Support_Files_CC2015:Contract Catalog:Snippets:2hl.inds"
place file (pageSnippetpath as string) on page 1
end tell
end tell
Copy link to clipboard
Copied
I’m not using Catalina but does an alias work?
Rather than using place file(string) set the path as an alias and use place pageSnippetpath on page 1.
This works in HS.
tell application "Adobe InDesign 2020"
tell document 1
set pageSnippetpath to "Catalog_Builder_XML:Support_Files_CC2015:Contract Catalog:Snippets:2hl.inds" as alias
place pageSnippetpath on page 1
end tell
end tell
Copy link to clipboard
Copied
For me the as alias method this does not work at all on HS but it does work on Catalina. That makes 0 sense.
Thanks for the suggestion.
Copy link to clipboard
Copied
When you tried in HS did you remove the file() method?
For me this works in HS
tell application "Adobe InDesign 2020"
tell document 1
set pageSnippetpath to "Catalog_Builder_XML:Support_Files_CC2015:Contract Catalog:Snippets:2hl.inds" as alias
place pageSnippetpath on page 1
end tell
end tell
but this does not:
tell application "Adobe InDesign 2020"
tell document 1
set pageSnippetpath to "Catalog_Builder_XML:Support_Files_CC2015:Contract Catalog:Snippets:2hl.inds" as alias
place file(pageSnippetpath) on page 1
end tell
end tell
Copy link to clipboard
Copied
The different ways to refer to a file seems to be fever with InDesign on Catalina Using 'file' directly in the Indesign tell block does nor work for example.
But using 'alias' with a HFS-path still works:
tell application id "com.adobe.indesign"
tell rectangle 1 of document 1
place file "path:to:image.jpeg"
end tell
tell text frame 1 of document 1
place file "path:to:text.txt"
end tell
end tell
However – strangely enough – a 'file' reference also works when defined by the script outside the InDesign tell block. So this also works:
set imageFile to POSIX file "/path/to/IMG_2592.jpeg"
--> file "Macintosh HD:path:to:IMG_2592.jpeg"
set textFile to POSIX file "/path/to/test.txt"
--> file "Macintosh HD:path:to:test.txt"
tell application id "com.adobe.indesign"
tell rectangle 1 of document 1
place imageFile
end tell
tell text frame 1 of document 1
place textFile
end tell
end tell
I would guess the latter method, at least, would work with any Mac OS version, grahamsprague
Copy link to clipboard
Copied
The different ways to refer to a file seems to be fever with InDesign on Catalina Using 'file' directly in the Indesign tell block does nor work for example.
But using 'alias' with a HFS-path still works:
tell application id "com.adobe.indesign" tell rectangle 1 of document 1 place file "path:to:image.jpeg" end tell tell text frame 1 of document 1 place file "path:to:text.txt" end tell end tell
However – strangely enough – a 'file' reference also works when defined by the script outside the InDesign tell block. So this also works:
set imageFile to POSIX file "/path/to/IMG_2592.jpeg" --> file "Macintosh HD:path:to:IMG_2592.jpeg" set textFile to POSIX file "/path/to/test.txt" --> file "Macintosh HD:path:to:test.txt" tell application id "com.adobe.indesign" tell rectangle 1 of document 1 place imageFile end tell tell text frame 1 of document 1 place textFile end tell end tell
I would guess the latter method, at least, would work with any Mac OS version, grahamsprague
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more