• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Folder action script tutorials?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Folder action script tutorials?
      • From: Paul Skinner <email@hidden>
References: 
 >Re: Folder action script tutorials? (From: pdf <email@hidden>)

  • Prev by Date: Re: Scripting Debugger's Palettes
  • Next by Date: Re: Graphical text via CGI
  • Previous by thread: Re: FW: Folder action script tutorials?
  • Next by thread: Re: Folder action script tutorials?
  • Index(es):
    • Date
    • Thread