Shortcut to move a file to specific location?

#1

There are a few iOS utilities I have that insist on saving a file in a specific location. Is there a way to create a shortcut that will move the selected file to a specific location?

The closes I have been able to do is use the Save Files to make a copy in the new location, but the original is still in the previous location.

#2

Shortcuts can currently only automatically access files within the Shortcuts folder in iCloud Drive. it has a wider scope on Dropbox. If your files are in iCloud Drive, then Shortcuts can potentially only do it only if you manually select the file operations.

#3

Thanks. The destination folder is on Dropbox, and the original file is either on iSH (the Unix emulator) or possibly Dropbox.

This is something that I wouldn’t need to worry about too much if the Favorites bar in Files actually worked.

#4

I use the iCloud Drive folder of Shortcuts and let Hazel do its magic with Files i stored there

#5

Dropbox would be fine. You could use a combination of get file, save file, delete file to perform a move. You just need to ensure consistency of naming or appropriate parameters being passed through - so not a share sheet option in Dropbox, more a direct action.

The iSH file provider isn’t going to be accessible without the manual select file and navigate step.

That would still require Shortcuts to do some moving for Dropbox and at that point, why not just do it with Shortcuts?*

iSH, might show up for Hazel on the Mac I guess, and you could trigger that by a file move within iSH.

* The exception I can think of for this is with large files, but you might want to run that on the Mac say via an SSH session to save mobile bandwidth.

#6

The original shortcut I made was:

  • Get File to use the browser to grab the file
  • Save File to save it to the specific location
  • Delete File Passed in Parameters (I think that is the one I used)
    It looks like it just deleted the file(s) after moving it. I will have to do more testing though.

I can tell you all the specific use cases I have, which might make it easier.

  1. I have a workflow inspired by an Adam Savage TED talk I saw a few years ago. It’s a Creative Inbox where anything he finds interesting he throws it in there and sorts it out later. So, on Dropbox I have a folder “1 - Creative\Inbox” where I just dump stuff I find interesting. Ideally, I’d like to do the file picker to do Recents or look for the file, or be able to have something in a Safari tab and save it to the folder.

  2. I use YouTube-DL via iSH to download YouTube videos. I’d like to use the file picker to move the files from where YouTube-DL downloads it in its File Provider and move it to a Dropbox YTDL folder.

I think the issue I am running into is the last step is deleting all the files and not the source file.

This is one of those times I miss either Hazel or a Finder Folder action.

#7

Sounds like you are passing in the new file rather than the original. Make sure you use Get file with the original file path before your delete step.

#8

This is what I built. I am not quite sure what you meant by Get File with the Original Path.

Also, I may be overthinking this. I noticed the Favorites issue for folders not sticking on the sidebar happens with Dropbox. It stays, err, stuck, if I drag out an iCloud Drive folder. Maybe just doing that is enough.

#9

thats why I dont move files with shortcuts at all. for me its just a pain to set-up these actions and so I just store them in the shortcuts folder (which will be emptied by hazel and if possible directly moved / tagged and so on). iOS is bad at (classic) file management and thats why I just store the files for later processing with hazel (or if needed by hand on the mac).

#10

In your screen shot you have the save immediately before the delete. So you are passing your newly saved file to the delete.

Duplicate that first get file after the save to get the original file once again so that you can delete that.

#11

Ah, ok. So I do this:
1- Get File to use the picker to choose SourceFile
2- Save File to save it to specified location
3- Get File to use the picker to choose SourceFile (again)
4- Action to delete the file.

#12

Kind of. I had thought you would be passing in a path rather than using the picker, so this slightly modified approach using a magic variable should speed things up for you.

*Example - Dropbox file move.

Hope that helps.

#13

Perfect! Thank you.

I really need to learn more about magic variables.