Skip navigation

Folder action to move all contents to HIDDEN folder?

951 Views 3 Replies Latest reply: Apr 4, 2013 4:57 PM by Batshua RSS
Batshua Level 1 Level 1 (65 points)
Currently Being Moderated
Apr 3, 2013 5:19 PM

My girlfriend has asked me for help with this, and my google-fu, which is normally strong, has failed me. We're looking to attach a folder action to a folder "Blaine" such that it will move any files that appear there will get automatically moved to ".Cute".

 

I have found a lot of scripts, but none of the ones I have found so far can actually move files to an invisible folder.

 

I don't mind modifying an existing script, but if I have to do that, I'm going to need some help setting up the paths to the folders, since so far trying to cobble together my own script has thrown up lots of errors.

 

I'm sure this would be easy for an AppleScript or Automator wizard, although I imagine AppleScript is more feasible because Automator was not able to see the hidden folder even when I toggled invisibility on files to make them visible.

 

Can anyone help us out?

 

Thanks so much for reading!

  • Frank Caggiano Level 7 Level 7 (22,890 points)

    I believe you'll  need to use the shell to do the copy I can't find a way to have the Finder see the invisible folder.

     

    So something like (as an AppleScript)

     

    set pathToSrc to (choose file)

    set pathToSrc to POSIX path of pathToSrc

     

    set pathToDest to ((path to desktop) as text) & ".noseeum"

    set pathToDest to POSIX path of pathToDest

     

    do shell script "cp " & pathToSrc & " " & pathToDest

    Will ask for a file and copy it to a folder in your desktop called .noseeum

  • twtwtw Level 5 Level 5 (4,585 points)

    The Finder has difficulty with invisible folders; System Events.app does not.  Something like this should work:

     

    on adding folder items to this_folder after receiving these_items

              set destination_folder to "/path/to/folder/named/.cute"

              tell application "System Events"

                        repeat with this_item in these_items

                                     move this_item to destination_folder

                        end repeat

              end tell

    end adding folder items to


Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.