Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Make any folder a burn folder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Make any folder a burn folder
Authored by: koncept on Sep 23, '05 07:56:01PM
I took the Applescript code being offered here and made a few tweaks. The changes I made were:

1) Bypass awk pipe and unecessary shell script commands
2) allow batch conversions of folders (items not folders will be ignored)
3) streamlined handler so that it will reverse burn folders if set already, and create them otherwise.

Please test this on non-important directories before assuming
that it is problem free (you already knew that though right?) ;)

tell application "Finder"
  set userSelection to selection
  repeat with thisItem in userSelection
    if class of thisItem is not folder then set userSelection to rest of userSelection
  end repeat
  if userSelection is not {} then my toggleState(userSelection)
end tell

on toggleState(aList)
  tell application "Finder"
    repeat with aFld in aList
      if name extension of aFld is not "fpbf" then -- normal folder
        set src to items 1 thru -2 of (text items of (POSIX path of (aFld as string))) as string
        set newSrc to src & ".fpbf"
      else if name extension of aFld is "fpbf" then -- revert
        set src to items 1 thru -2 of (text items of (POSIX path of (aFld as string))) as string
        set newSrc to items 1 thru -6 of src as string
      end if
      try
        do shell script "/bin/mv" & space & quoted form of (src) & space & quoted form of (newSrc)
      end try
    end repeat
  end tell
end toggleState


[ Reply to This | # ]