• 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
Re: EPS to PDF Watch Folder Dilemma
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EPS to PDF Watch Folder Dilemma


  • Subject: Re: EPS to PDF Watch Folder Dilemma
  • From: Alex Zavatone <email@hidden>
  • Date: Thu, 11 Mar 2010 12:32:43 -0600

Here is the wrapper for a folder action and needs to be saved as a script and applied to a folder.  Note the difference in how the action is triggered.

on adding folder items to thisFolder after receiving someItems
tell application "Finder"
set myDestination to (the container of thisFolder as text) & "Result:" as alias
end tell

tell application "Finder" to launch application whatever app you are using


set isLaunching to not IsMyAppRunning()


repeat while isLaunching
set isLaunching to not  IsMyAppRunning()
log "waiting for my app to launch"
end repeat


tell application "ImageOptim" to activate


-- filter out the file types you don't want


set myItems to {}
repeat with myItem in someItems
-- set myExtension to the name extension of myItem
set myNewItem to myItem as text
log myNewItem
if myNewItem ends with myFileExtension then set the end of myItems to myNewItem

end repeat


repeat with myItem in (myItems)
try
DumpfileInfo(myItem)
end try
end repeat


repeat while IsImageOptimProcessing()
delay 1
end repeat

end adding folder items to

on DumpfileInfo(myItem)
set myFile to the POSIX path of myItem
tell application "Finder"
try
set myshellScript to myShellCommand & myFile & "'"
--display dialog myshellScript
set myResult to do shell script myshellScript
end try
end tell
end DumpfileInfo

on  IsMyAppRunning()
tell application "my app name goes here"
if it is running then
set isRunning to true
else
set isRunning to false
end if
end tell
return isRunning
end IsMyAppRunning

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >EPS to PDF Watch Folder Dilemma (From: Richard Lake <email@hidden>)
 >Re: EPS to PDF Watch Folder Dilemma (From: Alex Zavatone <email@hidden>)
 >Re: EPS to PDF Watch Folder Dilemma (From: Richard Lake <email@hidden>)

  • Prev by Date: Re: EPS to PDF Watch Folder Dilemma
  • Next by Date: Re: EPS to PDF Watch Folder Dilemma
  • Previous by thread: Re: EPS to PDF Watch Folder Dilemma
  • Next by thread: Re: EPS to PDF Watch Folder Dilemma
  • Index(es):
    • Date
    • Thread