Re: OS X Trash script
Re: OS X Trash script
- Subject: Re: OS X Trash script
- From: "Bob.Kalbaugh" <email@hidden>
- Date: Thu, 29 Nov 2001 02:18:11 -0500
on 11/28/01 8:27 PM, Mr Tea at email@hidden wrote:
>
Hi
>
>
I've hidden my dock and made an OS X applet that sits on my desktop & sends
>
items dropped on it to the trash. (I call it 'Wastebasket')
>
>
I've found two nice icons to go with it (full and empty) and I'm wondering
>
if it's possible to toggle between the two using AS.
>
>
Mr Tea
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
What's this Mr.Tea? No brew of the day? If I'm not sippin', I must be
slippin'. ;-) For me, it's the caffeinated bean.
Here is some libation that may or may not help. You see, I'm not in OS X,
YET, but in OS 8.5.1, I've got a small script that I change the icon of
based on a few conditions. It's somewhat of a kludgey workaround, but works
nonetheless.
First off, the script lives on my desktop...
"HD:Desktop Folder:MyScript"
... also, I have three additional scripts, each with custom icons built in
ResEdit, ID number -16455, with [use custom icon] flag set true...
IconChangerA, IconChangerB, IconChangerC,
... which I keep in my *scripts* folder. All of them contain the same,
simple script:
--
delay 2
tell application "Finder"
set icon of file "HD:Desktop Folder:MyScript" to icon of (path to me)
end tell
--
Now, when MyScript runs, certain conditions are met and properties are set.
At the end of the run, right before the script quits, it calls one of the
IconChanger scripts based on the condition.
If condition A then
tell application "IconChangerA"
activate
end tell
else if condition B then...
...you get the idea. MyScript quits while the appropriate iconchanger waits
just a second or 2 before changing the icon.
So, will any of this help in OS X? I'm not sure. I would guess that resource
forks are a thing of the past, but I imagine that there is some way to
create an custom icon for a script, and I'm curious to learn if the ...set
icon of... line still works in that environment.
I DO have one other script that toggles *itself*, and does so quite nicely,
but again deals with ResEdit, a custom creator type, a Custom BNDL and 2
custom Icons, and I'm not sure how those resources are handled in X, or if
it even applies. I'm reluctant to post the method because of that, and
besides, this one has gone on long enough. However if you, or anyone else is
interested, feel free to say so, offlist or otherwise. I'll gladly share it.
Enjoy your tea.
bob.kalbaugh
PS. One other thought. Maybe some info can be found at www.resexcellence.com
I'm pretty sure they have some OS X mods.