• 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
help with a script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

help with a script


  • Subject: help with a script
  • From: "Joe Forzano" <email@hidden>
  • Date: Mon, 20 Dec 2004 17:02:51 -0500

Hi all,

I'm trying to implement a Photoshop 5.5 Folder Action script that will open and resave photos that are dropped into a folder on a shared volume.

Here's what the script looks like:

------------------------------------------------------------------------------------

tell application "Finder"
    set the theFolder to folder "Mac-1274:Users:pbpost:Desktop:ToDTI"
    set myFolderName to folder "FeaturesMainQueue"
end tell
property fileIndex : 0

tell application "Finder"
    set theFolderPath to theFolder as string
    tell application "Adobe Photoshop 5.5"
        close every document saving no
    end tell
   
    set filesList to files in theFolder
    repeat with aFile in filesList
       
        set fileIndex to fileIndex + 1
        set theFile to aFile as alias
        set theFileName to name of aFile
       
        tell application "Adobe Photoshop 5.5"
            set display dialogs to never
            open aFile
            set dupDocRef to current document
            set infoRef to get info of dupDocRef
            set newDocName to name of dupDocRef
            set newFileName to myFolderName
            copy length of (theFileName as string) to Filenamelength
            if Filenamelength > 31 then
                set TopLimit to (Filenamelength + (31 - Filenamelength))
                copy characters 1 through TopLimit of (theFileName) to shortFileName
                set shortFileName to shortFileName
            else
                set shortFileName to theFileName
            end if
            ------------
            --display dialog theFileName as string
           
           
           
           
           
            save dupDocRef in file ((newFileName as string) & (shortFileName as string)) as JPEG
           
           
            --save dupDocRef in file (newFileName as string) as JPEG
            --save dupDocRef in file (newFileName as string) as JPEG
            close current document without saving
        end tell
       
    end repeat
   
end tell

tell application "Finder"
    set the theFolder to folder "ToDTI"
    set theFolderPath to theFolder as string
   
    set filesList to files in theFolder
    repeat with aFile in filesList
        set fileIndex to fileIndex + 1
        set theFile to aFile as alias
        set theFileName to name of aFile
        delete aFile
       
    end repeat
    empty trash
end tell


-------------------------------------------------------------------------------------

This script was originally written for PS 7.0, and I've tried to convert it for 5.5, but I get the following error:

A identifier can't go after this identifier

on this line:

set display dialogs to never

I'm in no way an AppleScript guru (it was all I could do to write an AS to even make PS 5.5 open) so any help would be greatly appreciated.  Thanks much. . .

-joef

--
Joe Forzano
Editorial Systems Editor
Palm Beach Post
email@hidden
(561) 820-4565
www.palmbeachpost.com
 _______________________________________________
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: help with a script
      • From: "Shane Stanley" <email@hidden>
  • Prev by Date: Re: Coerce date saved as text back to Applescript's date format?
  • Next by Date: Re: help with a script
  • Previous by thread: getting across network to older OS
  • Next by thread: Re: help with a script
  • Index(es):
    • Date
    • Thread