• 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: Automate zip archives
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automate zip archives


  • Subject: Re: Automate zip archives
  • From: Peter Mathiessen <email@hidden>
  • Date: Thu, 09 Nov 2000 13:05:42 +0100

Nigel Garvey00-11-08 email@hidden

> Peter Mathiessen wrote on Wed, 08 Nov 2000 16:12:44 +0100:
>
>> Hi all,
>>
>> Is there anyone out there who already have done a script that take a bunch
>> of files and zip each of them into different archives.
>>
>> I have more than 2000 files that need to be made into zip archives, each of
>> them in their own archive. I have tried somewhat with ZipIt but haven4t
>> figured it out yet.
>>
>> Anyone that knows how or get a idea of some other application, it have be PC
>> compatible.
>
> The basic sequence for ZipIt in this case would be, for each file that
> you want to archive, to construct a name for the archive based on the
> name of the file (shortened if necessary) and a ".zip" suffix, and then:
>
> tell application "ZipIt"
> make new window
> add file "myPath:myFileName" -- add the file to the archive
> compress file "aPath:myArchiveName" -- save the archive as...
> close the front window
> end tell
>
> 'add' also takes a list parameter if you want to put several files at
> once into the archive.
>
> NG
> _______________________________________________
> applescript-users mailing list
> email@hidden
> http://www.lists.apple.com/mailman/listinfo/applescript-users


Hi,

I have made a script that takes a bunch of files and zip them in different
archives. The problem I have is it will not work properly, Zipit crashes all
the time. I have the script that Nigel wrote and that one works! What is
wrong?

My script:

tell application "Finder"
-- filecount
set countfolder to alias "Macintosh HD:count-folder:"
set foldercount to the count of every item of countfolder
if foldercount  1 then
-- flytt
set searchFolder to alias "Macintosh HD:count-folder:"
set myList to list folder searchFolder without invisibles
repeat with myFilename in every item in myList
set myFile to alias ("Macintosh HD:count-folder:" & myFilename)
move myFile to folder "zip-folder" of startup disk with
replacing

set searchFolder to alias "Macintosh HD:zip-folder:"
set myList to list folder searchFolder without invisibles
repeat with myFilename in every item in myList
set myFile to alias ("Macintosh HD:zip-folder:" &
myFilename)
tell application "ZipIt"
activate
make new window
add file ("Macintosh HD:zip-folder:" & myFilename)
compress file ("Macintosh HD:zip-folder:" & myFilename)

-- Zipit crashes here!

close the front window
end tell
end repeat
end repeat
end if
end tell



Nigel script (works):

tell application "ZipIt"
activate
make new window
add file "Macintosh HD:count-folder:4415_Y_Bearing_F.pdf" -- add the
file to the archive
compress file "4415_Y_Bearing_F.pdf" -- save the archive as...
close the front window
end tell

Best regards


References: 
 >Re: Automate zip archives (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: Scripter (The Program)
  • Next by Date: Re: Scripter (The Program)
  • Previous by thread: Re: Automate zip archives
  • Next by thread: Re: Automate zip archives
  • Index(es):
    • Date
    • Thread