Skip to main content
Participant
February 6, 2025
Answered

Applescript InDesign 2025 export JPG no longer works

  • February 6, 2025
  • 2 replies
  • 587 views

Hello everyone.

 

I created a script 2 years ago with INDD 2022 (I think).
When I try this script with INDD 2025 and MacOS Sequoia, it no longer works.
Basically, it creates QR codes from urls in an XLS file and export each QR codes as a JPG with a specific name.
There are more than 400 JPGs to do.

 

I've reduced the script as much as possible to find the error... and I don't understand.
JPG export doesn't work (I don't have a JPG file) without any error;
PDF export produces an error: Error in Adobe InDesign 2025: Unable to export PDF file (something like this… this is a translation of my french version)

Any idea?

 

Thanks a lot

 

tell application "Finder"

set myJPGfolder to "Macintosh HD:Users:olivier:Desktop:JPGs:" as alias

end tell

 

tell application "Adobe InDesign 2025"

activate

 

tell active document

set myRectangle to make new rectangle with properties {geometric bounds:{5, 5, 25, 25}}

set QRCodeURL to "https://www.apple.com"

set JPG_Name to "945_0"

 

Create Hyperlink QR Code myRectangle url link QRCodeURL

set myJpgFilePath to (myJPGfolder & JPG_Name & ".jpg") as string

set myPDFFilePath to (myJPGfolder & JPG_Name & ".pdf") as string

 

export to myJpgFilePath format JPG

export to myPDFFilePath format PDF type

end tell

end tell

Correct answer m1b

Hi @Olivier-Coolgray, here's a little script that might help.

- Mark

tell application "Adobe InDesign 2025"
	
	set exportPath to "/Users/mark/Desktop/JPGs/page.jpg"
	
	-- Check if a document is open
	if (count of documents) is 0 then
		display dialog "No document is open!" buttons {"OK"} default button "OK"
		return
	end if
	
	set doc to document 1
	set pageNum to 1 -- Change this to export a different page
	
	tell JPEG export preferences
		set anti alias to true
		set Page String to pageNum as string
		set Exporting Spread to false
		set JPEG export range to export range
		set JPEG Quality to maximum
		set export resolution to 300
		set use document bleeds to false
	end tell
	
	tell doc
		-- Export the page as a JPG
		export to exportPath format JPG without showing options
	end tell
	
	display dialog "Export complete!" buttons {"OK"} default button "OK"
	
end tell

 

2 replies

m1b
Community Expert
m1bCommunity ExpertCorrect answer
Community Expert
February 6, 2025

Hi @Olivier-Coolgray, here's a little script that might help.

- Mark

tell application "Adobe InDesign 2025"
	
	set exportPath to "/Users/mark/Desktop/JPGs/page.jpg"
	
	-- Check if a document is open
	if (count of documents) is 0 then
		display dialog "No document is open!" buttons {"OK"} default button "OK"
		return
	end if
	
	set doc to document 1
	set pageNum to 1 -- Change this to export a different page
	
	tell JPEG export preferences
		set anti alias to true
		set Page String to pageNum as string
		set Exporting Spread to false
		set JPEG export range to export range
		set JPEG Quality to maximum
		set export resolution to 300
		set use document bleeds to false
	end tell
	
	tell doc
		-- Export the page as a JPG
		export to exportPath format JPG without showing options
	end tell
	
	display dialog "Export complete!" buttons {"OK"} default button "OK"
	
end tell

 

Participant
February 6, 2025

Thanks Mark,
I had found the problem: the path to the folder was not longer correct.

m1b
Community Expert
Community Expert
February 6, 2025

Ah! Okay. 🙂

Participant
February 6, 2025

I found this and it seems to work

tell application "Finder"

set myFolder to POSIX path of ("/Users/olivier/Desktop/JPGs/")

end tell

leo.r
Community Expert
Community Expert
February 6, 2025
quote

POSIX path of

By @Olivier-Coolgray

 

Yes, the support for HFS paths has been discontinued in InDesign 2025, only POSIX paths should be used.

 

If you ask me, Adobe didn't do a good job communicating this change to the users, which caught many of them by surprise and with no clear explanation for the errors.