• 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
Fw: Resolving Photoshop naming multi-pg PDF's when opening
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fw: Resolving Photoshop naming multi-pg PDF's when opening


  • Subject: Fw: Resolving Photoshop naming multi-pg PDF's when opening
  • From: Brett Conlon <email@hidden>
  • Date: Fri, 4 Nov 2005 09:37:43 +1000


Anyone with any thoughts?

Dispite having told everyone to avoid using multi-page PDF files they are still coming to me every day saying that they have had this error, after dropping a multi-page PDF onto the droplet. <sigh>

All suggestions greatfully received!  <8-}

Coj


----- Forwarded by Brett Conlon/HU/AU/SonyDADC on 04/11/05 10:33 AM -----
Brett Conlon/HU/AU/SonyDADC

02/11/05 04:02 PM

To
Apple Script
cc
Subject
Resolving Photoshop naming multi-pg PDF's when opening




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

  • Follow-Ups:
    • Re: Resolving Photoshop naming multi-pg PDF's when opening
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Selecting Multiple Files
  • Next by Date: Re: changing keyboard shortcut check boxes
  • Previous by thread: Resolving Photoshop naming multi-pg PDF's when opening
  • Next by thread: Re: Resolving Photoshop naming multi-pg PDF's when opening
  • Index(es):
    • Date
    • Thread