Difference between scripting on OS 9.2 and OS 10.2.8
Difference between scripting on OS 9.2 and OS 10.2.8
- Subject: Difference between scripting on OS 9.2 and OS 10.2.8
- From: Nick Hearn <email@hidden>
- Date: Thu, 11 Mar 2004 11:59:01 -0000
I've been working on a script that will batch ZIP files and with some very
useful help along the way have come up with the script below.
The script works fine in OS 10.2.8, please can someone explain how the
script will need amending to run properly in OS 9.2.
At present the script produces varying results in OS 9.2 and is a little
unstable.
TIA
Nick
Here's the script:-
on run
open {choose file}
end run
on open fileList
tell application "ZipIt" to activate
repeat with i from 1 to (count of fileList)
set this_file to (item i of fileList)
set fileName to my deleteExtension(name of (info for this_file))
set zipFileName to (fileName & ".zip")
set zipFolder to my getContainer(this_file as string)
my make_zip_archive(this_file, zipFileName, zipFolder)
end repeat
try
tell application "ZipIt" to quit
end try
end open
on make_zip_archive(this_file, zipFileName, zipFolder)
tell application "ZipIt"
set the_window to (make new window at beginning)
add this_file to the_window
compress the_window name zipFileName in (zipFolder as alias)
close window 1
end tell
end make_zip_archive
on deleteExtension(the_name)
if character -4 of the_name = "." then
return text 1 thru -5 of the_name
else if character -5 of the_name = "." then
return text 1 thru -6 of the_name
else
return the_name
end if
end deleteExtension
on getContainer(the_path)
set old_delim to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set the_container to (text items 1 thru -2 of the_path) as string
set AppleScript's text item delimiters to old_delim
return (the_container & ":") as string
end getContainer
_______________________________________________
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.