User Tools

Site Tools


action:File_Actions

**This is an old revision of the document!**

File Actions

This Action is actually a multipurpose Action that provides the following Options: (Most Options can be used with either a File or Folder, except as indicated.)

  • Reveal in Finder
  • Create Unique File (v10.0+)
  • Move (v11.0+)
  • Rename (v11.0+)
  • Move or Rename
  • Copy
  • Duplicate
  • Move to Trash
  • Delete File (permanently)
  • Delete Directory (permanently)

Delete is obviously dangerous, and Delete Directory is extremely dangerous. Ensure you have full system backups before using this action.

How To Use

Select the action you wish to perform.

Click the File Chooser button on the right of an action to select an existing file or folder on disk. Option-click on the File Chooser button to show the currently selected file or folder in the Finder (assuming it exists already).

The Action Options (as shown in the popup above) are:

Option Description
Reveal brings the Finder to the front with the file or folder selected.
Create Unique File (v10.0+) create a new unique file based on the path you supply, adjusting the basename to something unique, and returning the new file path in the specified variable.
Move (v11.0+) moves a file or folder.
Rename (v11.0+) renames a file or folder.
Move or Rename moves and/or renames a file or folder.
Copy copies a file or folder. You must specify a name and location for the copy.
Since this requires a destination for the copy, if you want to just copy the file to the Clipboard, see MACRO: Choose File and Copy It [Example]
Duplicate duplicates a file within the same folder and adds copy to the filename.
Trash moves a file or folder to the Trash from where it can easily be recovered.
Delete File deletes a file (but not a folder) with no warnings or confirmation messages. The file is deleted and not moved to the Trash. Be careful with this action.
Delete Directory Be extremely careful with this action as it deletes the folder and all its contents with no warnings or confirmation messages.

Move and/or Rename

The option MoveorRename allows you to do three different things, based on the data you supply in the to field. In all cases, the Source Item Path field must be the full path to the source Finder item (file or folder) that is being acted upon.

If you specify a folder in the to field (eg ~/Documents/SomeFolder), the file will be moved to the specified folder.

If you specify a file name (without any slash /) (eg NewName.jpg), then file file will be renamed.

If you specify a full path to a new location with a new name (optionally the same name) (eg ~/Documents/SomeFolder/SomeName.jpg), then the file will be moved and renamed.

The Move option requires the to field to specify an existing folder and moves the specified source file or folder to the new location.

The Rename option requites the to field to specify only a file name (without any slash /) and renames the file or folder without moving it.

Overwrite Existing File(s)

You will get an error/failure if the destination file already exists. So, if you want to overwrite the destination file, you will need to first move the destination file to macOS Trash. For an example of this, see How to move all files in a specific folder and replace

See Also

Actions

Forum

Keywords: Create Folder, Move to Trash, Copy File, Copy Folder, Duplicate File, Reveal File, Reveal Folder, Move File, Move Folder

action/File_Actions.1694576291.txt.gz · Last modified: 2023/09/12 23:38 by peternlewis