Jump to content

Error in Workflow to move multiple files

Recommended Posts

Hi everyone,


I am trying to set up a very simple workflow: 


  1. Select one to n items in Finder
  2. Fire up the Alfred dialogue with file actions
  3. Automatically select the "move to" file action
  4. Type in the folder I want to move files to
  5. Files are moved


What I have so far: 




This works perfectly, but only for ONE file. i.e. if I select multiple files, only one shows up in Alfred.





And this works for multiple files (I defined ^+SHIFT + < as File Action trigger), but it doesn't register cmd+8 for some reason. I.e. I get to the file actions dialogue but would have to hit cmd+8 myself. 


Can anyone help? 



Share this post

Link to post

Yes, I'm aware of that. However, this hotkey requires you to first activate it and THEN press "cmd+6" to get to the "move to" dialogue. I'd like to be able to do BOTH with one hotkey. Thanks

Share this post

Link to post
1 minute ago, nonickfx said:

However, this hotkey requires you to first activate it and THEN press "cmd+6" to get to the "move to" dialogue


That isn't going to work. Your workflow has ⌘8. Now you're pressing ⌘6. You can't hardcode a Hotkey that keeps changing.


You'd be better off using Alfred's AppleScript API to action the files, type "move to" in the query box, then simulate ↩.

Share this post

Link to post

The problem is not that the hotkey is changing, I can hardcode ⌘8 and it would be enough for me. The problem is that I can't find a way to select multiple files and then trigger the File Action list AND the Move-to action. Is there any way to do this?


Regarding your solution: I didn't quite understand how I'd do it. Can you please elaborate a bit? 



Share this post

Link to post

tell application "Finder" to set selList to selection as alias list


if selList is not equal to {} then

    tell application "Alfred 3" to action selList

    tell application "System Events"

        keystroke "Move to"

        key code 36 -- Return

    end tell

end if

Share this post

Link to post

Wow, works exactly as I wanted, thanks a lot!!!


Just to make sure: I am connecting the hotkey to "Run Script" and set it to "usr/bin/osascript" and "with input as argv" , correct? (sorry, I'm a total Alfred newbie).


p.s. enjoy your beer, just sent you one ? ?

Share this post

Link to post

Yup, that's right. The input doesn't matter, though, as the script gets the files directly from Finder.


Thanks very much for the beer money! I'll get a couple of bottles to enjoy while France destroys Germany tonight :) 

Share this post

Link to post

Hi everyone,


so after an update to Catalina the following script doesn't work anymore: 


tell application "Finder" to set selList to selection as alias list


if selList is not equal to {} then

    tell application "Alfred 3" to action selList

    tell application "System Events"

        keystroke "Move to"

        key code 36 -- Return

    end tell

end if


Can anyone help? I can't figure out what's wrong :(



Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...