Re: Newie To AppleScripts, would like someone to look over a script
Re: Newie To AppleScripts, would like someone to look over a script
- Subject: Re: Newie To AppleScripts, would like someone to look over a script
- From: Michelle Steiner <email@hidden>
- Date: Tue, 2 Jan 2001 14:48:06 -0800
On 1/2/01 2:02 PM, Micah <email@hidden> wrote
>
Hello, my name is Micah, and i am brand new (today) to applescripts, but, i
>
am a fast learner, and i want to know how to lock items with a script. I
>
would also like to know, if there is a group of files you want to lock, in a
>
folder, how you lock them all at once, or use a script to lock all of them
>
even if you don't have thier names.
Here's a quick and dirty script. Save it as an applet, which will
automatically make it a droplet. Drag the files on it, and they will be
locked. The files in any folders dragged onto it will be locked; this is
recursive.
on open (itemList)
repeat with SomeItem in the itemList
lockit(SomeItem)
end repeat
end open
to lockit(myitem)
if the last character of (myitem as text) is not ":" then
tell application "Finder"
set the locked of myitem to true
end tell
else
set anotherlist to list folder myitem without invisibles
repeat with eachItem in anotherlist
set itemtolock to alias ((myitem & eachItem) as text)
lockit(itemtolock)
end repeat
end if
end lockit
Question to everyone: If an alias is dragged onto the droplet, the
alias's original will be locked; what changes are needed to lock the
alias file? I can't figure that out.
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------