Re: Stuffit Commands and Lists
Re: Stuffit Commands and Lists
- Subject: Re: Stuffit Commands and Lists
- From: "Marc K. Myers" <email@hidden>
- Date: Thu, 21 Jun 2001 08:37:49 -0400
- Organization: [very little]
>
Date: Wed, 20 Jun 2001 23:54:41 +0100
>
To: Applescript Mailing List <email@hidden>
>
From: Pier Kuipers <email@hidden>
>
Subject: Stuffit Commands and Lists
>
>
Hi all,
>
>
Is there a quick way to coerce a list of files to a list of aliases?
>
>
I just wrote a little script that will compress a folder prior to
>
backup, containing the following snippet, which I find a bit
>
cumbersome...:
>
>
choose folder with prompt "Please select a folder to be compressed:"
>
tell application "Finder"
>
set theContents to (every item of the result) as list
>
set x to count theContents
>
set p to 1
>
set theFilesToStuff to {}
>
repeat with i from 1 to x
>
set theFilesToStuff to theFilesToStuff & (item p of theContents as alias)
>
set p to p + 1
>
end repeat
>
end tell
>
>
Any nice ideas out there?
If you're running a version of the OS later than 8.1, the Finder will
coerce a list of file specs into a list of aliases. Instead of
>
set theContents to (every item of the result) as list
try
set theContents to (every item of the result) as alias list
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[6/21/01 8:35:42 AM]