Skip to main content
LawtonKAR
Participating Frequently
October 14, 2024
Answered

Scripts Not Functioning After Update to InDesign CC 2025

  • October 14, 2024
  • 4 replies
  • 12384 views

I have a load of scripts used to produce different PDF's. These will not work in the New InDsesign 2025.

Attched screenshot of error message.

This is one of the codes which I have used for over 10 years until the new version.

tell application id "com.adobe.indesign"

 

set _NoCrops to PDF export preset "No Crops"

set _Crops to PDF export preset "Crop NO Text"

set _dest to path to desktop as string

tell active document

set _Name to name

if _Name ends with ".indd" then

set _Name to text 1 thru -6 of _Name

end if

set noCropPath to _dest & _Name & " PROOF" & ".pdf"

set cropPath to _dest & _Name & " PRINT" & ".pdf"

export format PDF type to noCropPath using _NoCrops without showing options

export format PDF type to cropPath using _Crops without showing options

end tell

end tell

 

tell application "Finder"

set label index of file noCropPath to 7

set label index of file cropPath to 2

end tell

 

 

<Title renamed by MOD>

Correct answer leo.r

I think i might be in way over my head here as I have no idea what to do with that i'm sorry.


quote

I think i might be in way over my head here as I have no idea what to do with that i'm sorry.


By @Luke25170286g4xv

 

 

In your particular script, all you need to do is change

 

export format PDF type to mgFilePath using "HR PDF" without showing options

 

to 

 

export format PDF type to (POSIX path of mgFilePath) using "HR PDF" without showing options

4 replies

Participating Frequently
March 5, 2025

Hi all, apologies for tagging along with this post but i'm also having a similar problem since updating to Indesign 2025 (v20). We run a script which outputs indiviual pdf pages from a multi page document, named using a specific filename on a seperate layer into a HR Folder in the same folder location as the active indesign doc. This has worked for years prior, and still does with Indesign 2024 so just wondering what the fix could be here? Currently holding back on full update to 2025 but with a lot of other colleagues starting to update it's becomming a bit of a problem.

I run the script and it still runs as it should without any error messages however, in the HR PDF folder that it creates it is always empty with no PDF exported? Any help would be massively appreciated. Script we're using is attached below for ref - thank you! 

Robert at ID-Tasker
Brainiac
March 5, 2025
Participating Frequently
March 5, 2025

Thanks @Robert at ID-Tasker , explains it clearly for a novice like myself to understand! So knowing that, is there a way to adjust/tweak the current script for it to work in POSIX path Style at all? 

LawtonKAR
LawtonKARAuthor
Participating Frequently
October 16, 2024

The probelm is that InDesign isn't producing the PDF's.
I have removed the last part of the code, this elimates the error code, because it can't find the PDF's on the desktop.

Looking at other comments about paths need changing, this line may be the problem
'set _dest to path to desktop as string'. 

Can anyone advise how the path should be up dated to work in v20.0.

leo.r
Community Expert
October 16, 2024
quote

Looking at other comments about paths need changing, this line may be the problem
'set _dest to path to desktop as string'. 

Can anyone advise how the path should be up dated to work in v20.0.


By @LawtonKAR

 

for a quick solution, just use POSIX path of cropPath

 

i can't go further into depth about posix paths right now, but you can look up something like 'posix paths in AppleScript'

 

LawtonKAR
LawtonKARAuthor
Participating Frequently
October 16, 2024

Thanks you Can now exprt the 2 PDF's and add the extra words to the file name using this line

set _dest to "Machintosh HD/Users/username/Desktop/"

Just need to sort label tag colour change.

Robert at ID-Tasker
Brainiac
October 14, 2024
Participating Frequently
October 15, 2024

I have same issue in a way: a script that works perfectly with Indesign 2024 it crashed completely with Indesign 2025. I changed the paths to POSIX but with no luck. 

the script takes a list of indd files from a specific folder then

1. creates a package 

2. export an idml file

3. export a preview rgb pdf 

4. converts some color to a specific cmyk value

5. export print pdf 

6. reactivate a layer

 

In Indesign 2025, after updating paths to POSIX: 

1. creates a package corectly

2. fails to export an idml file. even the path is correct but does not save the file, and there is no error message

3. fails to export a preview rgb pdf:

error "Adobe InDesign 2025 got an error: Failed to Export the PDF file." number 9485

 

If it helps I can share the script

Thanks

 

Participating Frequently
October 15, 2024

Ok I can only report that after changing all paths to POSIX, I don't have any issues packaging files (including IDML and PDF).

 

Try to isolate the error and post the specific lines of code that cause the error here.


this is the export part and attached are two dialog windows that are listing the path for .idml and .pdf 

-- export idml to OneDrive 

export active document format InDesign markup to file (export_path & OpenFileNameActiveWOExt & ".idml") without showing options

display dialog (export_path & OpenFileNameActiveWOExt & ".idml")

--pdf export -- 

tell PDF export preferences

set use security to true

set disallow changing to true

--set security

set use security to true

set change security password to zero_pad

end tell

-- export interactive to OneDrive 

display dialog (export_path & OpenFileNameActiveWOExt & "-interactive.pdf")

export active document to file (export_path & OpenFileNameActiveWOExt & "-interactive.pdf") format PDF type using PDF export preset thePdfPresetForInteractive without showing options

leo.r
Community Expert
October 14, 2024

You must use POSIX paths starting with InDesign 2025 (as opposite to legacy comma-separated HFS paths). 

leo.r
Community Expert
October 14, 2024

p.s. would be nice if Adobe communicated this change more obviously to the regular users.