pancakes

MicrostockGroup Sponsors


Author Topic: Help with apple script  (Read 2728 times)

0 Members and 1 Guest are viewing this topic.

« on: November 15, 2009, 10:10 »
0
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

Cant 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.


 

Related Topics

  Subject / Started by Replies Last post
11 Replies
12196 Views
Last post September 09, 2009, 04:49
by Microbius
61 Replies
18894 Views
Last post March 10, 2011, 16:47
by madelaide
2 Replies
4577 Views
Last post May 26, 2011, 06:28
by spike
3 Replies
4134 Views
Last post August 30, 2011, 09:30
by microstockphoto.co.uk
0 Replies
2393 Views
Last post May 09, 2012, 13:44
by kelby

Sponsors

Mega Bundle of 5,900+ Professional Lightroom Presets

Microstock Poll Results

Sponsors