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

Catalina and AppleScript: missing parameter filename from method open

New Here ,
Feb 11, 2020 Feb 11, 2020

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

 

TOPICS
Bug , Scripting
1.3K
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
New Here ,
Feb 11, 2020 Feb 11, 2020

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

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 ,
Feb 11, 2020 Feb 11, 2020

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

 

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
New Here ,
Feb 11, 2020 Feb 11, 2020

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.

 

 

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 ,
Feb 11, 2020 Feb 11, 2020

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

 

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 ,
May 27, 2020 May 27, 2020

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

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 ,
May 27, 2020 May 27, 2020
LATEST

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

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