MicrostockGroup

Microstock Photography Forum - General => Off Topic => Topic started by: nicemonkey on November 15, 2009, 10:10

Title: Help with apple script
Post by: nicemonkey on November 15, 2009, 10:10
Help, I need some trouble shooting advice with apple script, I have set up a script to convert a jpeg and eps into one zip file but come up with an error. which is below

Can’t make «class cfol» "zip folder" of «class cfol» "Desktop" of «class cfol» "michaeltravers" of «class cfol» "Users" of «class sdsk» of application "Finder" into the expected type.

This is the script

tell application "Finder"
set startFolder to (folder "Macintosh HD:Users:michaeltravers:Desktop:zip folder")
set startFolder_POSIX to quoted form of POSIX path of startFolder -- we'll need this later

-- get the JPEG filenames
set JPEGfiles to (name of every file of startFolder whose name extension is "jpeg") as alias list
-- iterate through them
repeat with eachFile in JPEGfiles
-- get the base name (without the extension)
set baseName to (characters 1 through -6 of eachFile) as text
-- do we have a corresponding .eps file?
if exists file (baseName & ".eps") of folder startFolder then
-- if so, create a zip file containing the two items
set zipfilename to quoted form of (baseName & ".zip")
set jpegfilename to quoted form of (baseName & ".jpeg")
set epsfilename to quoted form of (baseName & ".eps")
do shell script "cd " & startFolder_POSIX & "; zip " & zipfilename & space & jpegfilename & space & epsfilename
end if
end repeat

end tell

any advice on where I am going wrong would be gratefully received.