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

PDF file name in applescript

Guest
Feb 07, 2012 Feb 07, 2012

I have created a applescript to export 2 PDF's from the same file at the same time. One with crop marks and the second with out. I would like the original file name to be used, but can not seem to get this right. Below is the script. Where it says 'No Crops' or 'Crops' I would like the Indesign file name to be placed.

Can any one help with this please?

Andy

tell application "Adobe InDesign CS5"

          tell active document

                    export format PDF type to "/Users/username/Desktop/No Crops X.pdf" using "No Crops" without showing options

                    export format PDF type to "/Users/username/Desktop/Crops.pdf" using "Crops with Text" without showing options

          end tell

end tell


TOPICS
Scripting
1.1K
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 1 Correct answer

Guru , Feb 07, 2012 Feb 07, 2012

I don't have your options so I just comment out those lines…

tell application "Adobe InDesign CS5"

          tell active document

                    set docName to name

                    set ASTID to AppleScript's text item delimiters

                    set AppleScript's text item delimiters to "."

                    set baseName to text item 1 of docName

                    set AppleScript's text item delimiters to ASTID

  --log (path to desktop as text) & baseName & "_X.pdf"

  --export format PDF

...
Translate
Guru ,
Feb 07, 2012 Feb 07, 2012
LATEST

I don't have your options so I just comment out those lines…

tell application "Adobe InDesign CS5"

          tell active document

                    set docName to name

                    set ASTID to AppleScript's text item delimiters

                    set AppleScript's text item delimiters to "."

                    set baseName to text item 1 of docName

                    set AppleScript's text item delimiters to ASTID

  --log (path to desktop as text) & baseName & "_X.pdf"

  --export format PDF type to (path to desktop as text) & baseName & "_X.pdf" using "No Crops" without showing options

  --export format PDF type to (path to desktop as text) & baseName & ".pdf" using "Crops with Text" without showing options

          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