Re: Simple Pict conversion help
Re: Simple Pict conversion help
- Subject: Re: Simple Pict conversion help
- From: Mr Tea <email@hidden>
- Date: Mon, 24 Mar 2003 18:07:08 +0000
This from Dave Groover - dated 24/3/03 2:22 pm:
>
I am not sure I even need an application for this as [converting a JPEG into a
PICT] should be something the system is already capable of doing.
Why's that, Dave?
>
>
The whole point of this is to create a drop folder action where I can
>
drag gifs or JPEGS off the Internet and convert them to a simple pict
>
file. No tweaking, just convert. I would like it to be set up as a
>
batch process but really one at a time would do nicely. I suppose it
>
really wouldn't matter what format it was in to start, so long as
>
converting the file type to pict would work.
Have you looked at GraphicConverter's batch conversion options? Check out
the window that pops up when you choose 'convert' from the file menu. The
advantage of using a GC watched folder is that the items will be converted
without having to be opened in a window onscreen.
If you want to go the AppleScript route, this folder action will hopefully
do something close to what you need:
property pictFolder : ""
property dialog_timeout : 10
on adding folder items to dropFolder after receiving theFiles
tell application "Finder"
activate
if pictFolder is "" then
set thePrompt to "Select or create destination folder..."
choose folder with prompt thePrompt returning pictFolder
end if
end tell
repeat with i from 1 to count of theFiles
set processIt to false
set aFile to item i of theFiles
tell application "Finder"
if (get kind of aFile) is not "Folder" then
--if (get file type of file aFile) is "JPEG" then
set my text item delimiters to "."
get text items 1 thru -2 of (get name of aFile) returning theName
set my text item delimiters to ""
set processIt to true
set newFile to "" & pictFolder & theName & ".pct"
--end if
end if
end tell
if processIt then pictify(aFile, newFile)
end repeat
end adding folder items to
on pictify(aFile, newFile)
tell application "GraphicConverter"
activate
try
open aFile
save window 1 as "PICT" in newFile with makeCopy
close window 1
on error errmsg
display dialog errmg giving up after dialog_timeout
end try
end tell
end pictify
The script will ask for a destination folder the first time it's run, and
will store that as a default location until the script is edited. If you
want to use something other than GraphicConverter to convert the files,
change the contents of the 'pictify' handler accordingly.
HTH
Nick
pp Mr Tea
--
Brew of the day: Yorkshire Gold by Bettys & Taylors of Harrogate
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.