Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Folder action to move all contents to HIDDEN folder?

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!

Posted on Apr 3, 2013 3:35 PM

Reply
3 replies

Apr 3, 2013 6:18 PM in response to Batshua

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

Apr 3, 2013 9:07 PM in response to Batshua

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


on adding folder items tothis_folderafter receivingthese_items

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

tell application "System Events"

repeat with this_item in these_items

movethis_itemtodestination_folder

end repeat

end tell

end adding folder items to

Folder action to move all contents to HIDDEN folder?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.