Re: Folder action script tutorials?
Re: Folder action script tutorials?
- Subject: Re: Folder action script tutorials?
- From: Paul Skinner <email@hidden>
- Date: Mon, 05 Mar 2001 16:46:31 -0500
on 3/3/01 5:49 AM, pdf wrote:
SNIP
>
Marc:
SNIP
>
>
And... ?somebody can explain me how can I attach an action to folder
>
"desktop folder"? (OS 8.6)
I've heard it said that it can't be done, BUT...
( PB bronze/400/OS 9.1/AS 1.5.5/C.lib 1.2.5)
--Converted using Wacky ListServer v1.0 : )
--begin script
--To attach a script to the Desktop Folder.
set scriptNames to ""
set theDesktop to (path to desktop folder)
set theScript to choose file with prompt "Pick a script"
tell application "Folder Actions"
attach action to theDesktop using theScript
set the AttatchedScripts to attached scripts of theDesktop
set AppleScript's text item delimiters to ":"
end tell
repeat with thisAttatchedScript in item 1 of AttatchedScripts
set scriptNames to scriptNames & text item -1 of (thisAttatchedScript as
text) & return
end repeat
display dialog "The following scripts are attatched to the desktop folder:"
& return & the scriptNames
--end script
So, clearly you can attatch scripts to the Desktop folder. But thay fail
to function as far as I can tell. This includes using Folder actions plus.
If anyone can get them to work, I'd love to hear about it.
By the way, to remove the scripts you've attatched to your DT folder, if
you actually ran that script on you box, which you should never do without
fully groking the result : )...
--Also Converted using Wacky ListServer v1.0 : )
--begin script
--To remove all attached scripts from the Desktop Folder.
set allRemoved to false
set theDesktop to path to desktop folder
repeat while allRemoved true
tell application "Folder Actions"
try
remove action from theDesktop using action number 1
on error
set allRemoved to true
end try
end tell
end repeat
display dialog " The Desktop Folder has no actions attatched to it."
--end script
--
Paul Skinner