MACSCRPT Archives

March 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Philip Aker <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Mon, 20 Mar 2006 07:09:14 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (68 lines)
On 2006-03-19, at 17:25:53, Nobumi Iyanaga wrote:

>> Say you have a file on your desktop called "file.txt". Then the  
>> call is:
>>
>> 	cd ~/Desktop;zip file file.txt
>>
>>
>> or for a folder with some ".txt" files in it:
>>
>> 	cd ~/Desktop;zip xxx xxx/*.txt
>>
>>
>> or for just one file in that folder:
>>
>> 	cd ~/Desktop/xxx;zip ../y y.txt
>>
>>
>> If you don't do the 'cd' portion, then the full directory path of  
>> the file(s) is nested into the .zip output.

> Thank you very much for your help.

> I tried these commands, and they worked just as expected.  So, if I  
> understand well, this means that the second argument is the  
> "object" of the command, and the first argument is the name of the  
> resulting zip file to which the extension (".zip") is added  
> automatically...??

Yes. Often the unix tool man pages use terms such as "input, "in",  
or, "src", for "object" as you say above. And for the result, some  
terms used are "output", "out", and "dst".


> One thing I tried and could not get the expected result is to zip  
> an application. I tried:

> cd ~/Desktop
> zip man_viewer man_viewer.app


Jim Tittsler has answered your questions very well.

Another option might be to use:

/System/Library/CoreServices/BOMArchiveHelper.app/Contents/MacOS/ 
BOMArchiveHelper ~/Desktop/some.app

 From Script Editor, a 'do shell script' is:

set input to POSIX path of ((path to desktop as string) & "some.app")
do shell script "open -a BOMArchiveHelper " & input

This is the application which the Finder contextual menu item uses  
but I don't know how to supply it any options so the result file is:

~/Desktop/some.app.cpgz


Showing us that BOMArchiveHelper.app is probably a wrapper around the  
tool 'cpio' (see man cpio for details). Most likely with some extra  
code to handle resource forks.  However, do not change the resulting  
file extension to 'zip'.  You'll get a messy output.


Philip Aker
philip_aker->mac.dot.com

ATOM RSS1 RSS2