Jump to content

Move Selected Finder Item


talibusorabat

Recommended Posts

I love the way Matt Healy's Text Tools workflow looks, and I wanted a workflow to move selected finder items to a specific folder in the same way that you can create a new text file in his workflow.

 

I don't know Applescript or shell script, but I do know how to grab pieces of code from other places and throw them at Applescript editor until something works. After several weeks of googling and throwing rotten apples at the wall, I've finally gotten the workflow to work.

 

All you have to do is select the item you want in the Finder and type "move" and the name of the folder you want in Alfred.

 

Screen%20Shot%202014-04-04%20at%203.15.5

Then hit enter and voila! It moved!

 

You can download the workflow here.

 

 

Questions/comments/concerns/suggestions, please let me know! This is my first workflow and I have very little idea what I'm doing.

Link to post

Nice Idea,

I have modified the script, so that multiple selections are working:
 

on alfred_script(q)

 

tell application "Finder"

set source to selection

end tell

 

if (count of source) is greater than 1 then

set fileList to every item of source

repeat with source in fileList

doMove(source, q)

end repeat

else

doMove(source, q)

end if

 

end alfred_script

 

on doMove(source, destination)

 

set source to (POSIX path of (the source as alias))

set destination to POSIX path of destination

 

do shell script "mv" & space & quoted form of POSIX path of source & space & quoted form of POSIX path of destination

 

end doMove

 

 

Link to post

This is pretty awesome. 

 

1°) Is it possible to make it work with other file managers (i.e. Forklift) ? (tried to replace Finder with Forklift in the script but didn't work).

 

2°) Notifications are not working for me (no notifications)

 

3°) Is there a way to move the file to its parent folder via an action modifier? 

(i.e. select the file, type "move" in Alfred, click on enter+ctrl for example). 

 

4°) You didn't precise if it is working for files and/or folders. Files are working great not folders. 

Hope this is not a bug  :)

Link to post

1) Yes, it could work with other file managers, but no, it can't work with ForkLift, as it doesn't have any AppleScript support.

3) You could do that by adding a Keyword linked to another Run NSAppleScript that moves the selected files into their grandparent directory (they're already in their parent ;))
 
4) I can move folders with it just fine. 

Link to post
  • 4 weeks later...

@deanishe 

 

1°) Now I understand why some workflows work some don't with Forklift. Really glad to understand why.

 

3°) Unfortunately, I am not good enough at programming even if I know how to do it in the terminal with mv  :(

 

4°) You are right it works perfectly well with folders.

Link to post

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...