• 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:26:39 -0600

Here ya go.  I offer this only upon the condition that you help fix my horrible and ugly code.

This functions as a droplet app.  Save as an app and drop the files on top of it.  The next email will have the structure for a watch folder.

Since I'm working in shell scripting, I use POSIX paths in this.

This converts images to PNG files.
Cheers
-- Alex Zavatone

on xrun()
set myFile to "Macintosh HD:01.jpg"
Process(myFile)
end xrun

on open myFiles
set oldDelimiter to AppleScript's text item delimiters
repeat with myFile in myFiles
set ItemInfo to the info for myFile
if not folder of ItemInfo then
Process(myFile)
end if
end repeat
set AppleScript's text item delimiters to oldDelimiter
-- set myFile to "Macintosh HD:01.jpg"
end open

on Process(myFileAlias)
set myFile to myFileAlias as string


set AppleScript's text item delimiters to ":"
set myItemCount to the number of text items in myFile
set myFileName to the last text item of myFile
set myFilePath to text items 1 through (myItemCount - 1) of myFile


set AppleScript's text item delimiters to "."
set myItemCount to the number of text items in myFileName
set myExtension to the last text item of myFile
set myShortFilename to text items 1 through (myItemCount - 1) of myFileName


set AppleScript's text item delimiters to ""


set myPosixFile to the POSIX path of myFile


-- display dialog "myPosixFile " & myPosixFile


set AppleScript's text item delimiters to ":"
set newItem to myFilePath & myShortFilename as string
set AppleScript's text item delimiters to ""
set newItem to newItem & "-.png" as string
-- display dialog "newItem " & newItem
set myPosixNewItem to the POSIX path of newItem
-- display dialog "myPosixNewItem " & myPosixNewItem


set myShellString to "sips -s format png -s '" & myPosixFile & "' --out '" & myPosixNewItem & "'"


-- do it
do shell script myShellString
-- tell application "Finder" to set the label of newItem to "Green"


end Process
On Mar 11, 2010, at 11:59 AM, Richard Lake wrote:

Hi Alex,

Yeah I only need some basic structure to how this achieved.  Google isn't yielding anything productive.  I am currently looking at the possibility of using Adobe Acrobat's Distiller Applescript dictionary to see if that will help. ^^

I really need some direction on this one as I have hunted around for a for few days and getting no-where. :(

On 11 Mar 2010, at 17:53, Alex Zavatone wrote:

Want some code for that?

I can give you the basics and you can fill in the rest.

It's not perfect, parts of it are ugly and when doing file referencing, I ALWAYS (as in always) forget to wrap the file code in a Tell application "Finder" block.



Hi all,

I've been hunting around for a solution for what seems a popular request on the archives of the mailing list over the years.

How to let PC users drop EPSes in a folder and have them converted to a PDF on the fly?


Richard


 _______________________________________________
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