• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Resolving Photoshop naming multi-pg PDF's when opening
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Resolving Photoshop naming multi-pg PDF's when opening


  • Subject: Resolving Photoshop naming multi-pg PDF's when opening
  • From: Brett Conlon <email@hidden>
  • Date: Wed, 2 Nov 2005 15:02:28 +1000


Hi all,

Can someone help me to resolve a glitch in my Photoshop Action script?

Below is a working exerpt of the bit that is playing up.

The issue appears when a user drops a multi-page PDF onto the droplet. If they drop a single page PDF the filename in Photoshop ("Dog.pdf") is the same as the name of the file dropped onto it ("Dog.pdf") and all works as expected. However, when a multi-page PDF is dropped onto it, the name in the Photoshop file appears with a 1 at the end (presumably Pg1 - "Dog1.pdf"). The script is erroring on the red line below, where it is not finding the right file name.

Here's the important bit of the Event Log entry:
....
activate document "Dog.pdf"
                "Adobe Photoshop CS got an error: File/Folder expected"

The opened Photoshop file is named "Dog1.pdf"

Thinking forward, I wouldn't mind it giving the user more control over opening multi-page PDFs, even showing Photoshop's "PDF Page Selector" dialog if possible where the user can choose the pg to rasterise. The naming issue would then have to be resolved.

For most accounts the first page is the one they will most likely need to open.

Here's the code:

on open (filelist)
        repeat with aFile in filelist
                DoAllThis(aFile)
        end repeat
end open

--DO PHOTOSHOP STUFF
on DoAllThis(aFile)
        display dialog "Opening file into Photoshop. Please wait." buttons {"OK"} default button 1 giving up after 3
        tell application "Finder"
                set fileName to name of aFile
                set nameExt to name extension of aFile --> "pdf" or "psd", etc
        end tell
        tell application "Adobe Photoshop CS"
                activate
                -- open the file appropriately
                if nameExt is in {"eps", "pdf"} then
                        open aFile with options {class:PDF open options, mode:CMYK, resolution:300}
                else
                        open aFile
                end if
                tell document fileName
                        activate
                        do action "RUN ALL" from "FHE DVD Slick Packshots.atn"
                end tell
        end tell
end DoAllThis

Your help is most appreciated!

Regards,

Cojcolds
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Rsync reliability?
  • Next by Date: Re: Rsync reliability?
  • Previous by thread: Re: Maybe OT: getting general information of a pdf file (demski)
  • Next by thread: Fw: Resolving Photoshop naming multi-pg PDF's when opening
  • Index(es):
    • Date
    • Thread