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

Scripts Not Functioning After Update to InDesign CC 2025

Explorer ,
Oct 14, 2024 Oct 14, 2024

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>

TOPICS
Scripting
11.8K
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

correct answers 2 Correct answers

Explorer , Oct 16, 2024 Oct 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.

Translate
Community Expert , Mar 05, 2025 Mar 05, 2025
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
Translate
LEGEND ,
Mar 05, 2025 Mar 05, 2025

@Luke25170286g4xv

 

Sorry, I'm not a Mac user or AppleScript coder 😉

 

But it looks like you need to add conversion to POSIX.

 

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 ,
Mar 05, 2025 Mar 05, 2025
quote
By @Luke25170286g4xv

 

may i point you to the answer i have already given you:

 

POSIX path of yourHFSPath

 

for example:

 

POSIX path of mgFolder

 

(there are several other ways to obtain posix paths but this one is the easiest in your case).

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 Beginner ,
Mar 05, 2025 Mar 05, 2025

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

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
LEGEND ,
Mar 05, 2025 Mar 05, 2025
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

 

Will be much easier to modify your code - if you post it here as a code/text - instead of a screenshot.

 

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 Beginner ,
Mar 05, 2025 Mar 05, 2025

Thanks @Robert at ID-Tasker 

tell application id "com.adobe.InDesign"

set mgFolder to file path of active document

set mgDocName to name of active document

end tell

 

tell application "Finder"

if (exists folder "HR PDF" of folder mgFolder) is false then

make folder at mgFolder with properties {name:"HR PDF"}

end if

end tell

 

tell application id "com.adobe.InDesign"

repeat with x in pages of active document

set mgPageName to name of x

set page range of PDF export preferences to mgPageName

 

tell active document

 

set mgFrames to (text frames of x whose name of item layer is "file_name")

set mgFrame to item 1 of mgFrames

set mgText to contents of item 1 of mgFrame

set mgFilePath to mgFolder & "HR PDF:" & mgText & ".pdf" as string

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

end tell

 

end repeat

display dialog "Export complete legend" buttons {"OK"} default button 1

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 ,
Mar 05, 2025 Mar 05, 2025
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
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 Beginner ,
Mar 05, 2025 Mar 05, 2025

Absolute legend, worked a treat. Thank you so much @leo.r  and @Robert at ID-Tasker , keeping it simple for someone without any real prior knowledge of scrips and keeping patient at the same time. Thank you!!

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
LEGEND ,
Mar 05, 2025 Mar 05, 2025
LATEST

@Luke25170286g4xv

 

You're welcome. 

 

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