User Tools

Site Tools


action:File_Actions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
action:File_Actions [2017/03/05 20:58]
peternlewis [Forum]
action:File_Actions [2024/01/29 03:38] (current)
peternlewis
Line 1: Line 1:
 ====== File Actions ====== ====== File Actions ======
  
-This Action is actually a multipurpose Action that provides the following ​actions+This Action is actually a multipurpose Action that provides the following ​Options
-(All actions ​can be used with either a File or Folder) +(Most Options ​can be used with either a File or Folder, except as indicated.) 
-  * Move (and/​or ​Rename)+  * Reveal in Finder 
 +  * Create Unique File (v10.0+
 +  * Move (v11.0+) 
 +  * Rename ​(v11.0+) 
 +  * Move or Rename
   * Copy   * Copy
   * Duplicate   * Duplicate
   * Move to Trash   * Move to Trash
-  * Delete (permanently) +  * Delete ​File (permanently) 
-  * Reveal in Finder+  * Delete Directory (permanently)
  
-{{:action:​move-rename-action-km-7.3.png?​nolink|}} +Delete is obviously dangerous, and Delete Directory is extremely dangerous. Ensure you have full system backups before using this action.
- +
----+
  
 ===== How To Use ===== ===== How To Use =====
  
-You can either insert ​the main Action (shown above), and then choose the actual ​action to use in the dropdown, OR, insert one of the preconfigured Actions from the Action panel/​menu:​ +Select ​the action ​you wish to perform.
- +
-FIXME  JMichaelTX: ​ Insert Action panel screen shot here.+
  
 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). 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 actions +The Action Options ​(as shown in the popup above) are:
-  *//Copy a File// — copies a file or folder. You must specify a name and location for the copy. +
-  *//Delete a 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. +
-  *//​Duplicate a File// — duplicates a file within the same folder and adds // copy// to the filename. +
-  *//Move or Rename a File// — moves or renames a file or folder. +
-  *//Reveal a File// — brings the Finder to the front with the file or folder selected. +
-  *//Trash a File// — moves a file or folder to the Trash from where it can easily be recovered. +
-  *//Delete Directory//​. Be **extremely careful** with this action ​as it deletes ​the folder and all its contents with no warnings or confirmation messages.+
  
-Move or Rename lets you either move a file to a new locationor rename it in the same location, ​or move it to new location with new name If you wish to just move a file, specify an existing ​folder ​as the destination ​of the move.  If you wish to rename a file, specify ​the new name as the destinationeither by itself, or with full path that is in the same folder ​as the source location If you wish to move and rename ​a file, specify ​the full path of the destination,​ including the new name of the file in its new location.+^ Option ^ Description ^ 
 +^ Reveal | brings the Finder to the front with the file or folder selected. | 
 +^ Create Unique File (v10.0+) | create ​new unique ​file based on the path you supply, adjusting the base name to something uniqueand returning the new file path in the specified variable. | 
 +^ Move (v11.0+) | moves a file or folder. | 
 +^ Rename (v11.0+) | renames ​file or folder. | 
 +^ Move or Rename | moves and/or renames ​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 Clipboardsee [MACRO: ​  ​Choose File and Copy It [Example]](https://​forum.keyboardmaestro.com/​t/​choose-file-and-copy-it-example-macro-v9-0-2/​15581) | 
 +^ Duplicate | duplicates ​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|
  
-Note: The source path must be an absolute path (or a path relative to home ~). The destination path must either be a simple single path component (no ~ or /) or an absolute path. If it is a simple path component, then it is relative to the parent directory of the source path. As mentioned above, this is particularly useful in the Move or Rename ​action, as you can, for example, rename from ~/​Folder///​Old Name// to //New Name//.+==== Move and/or Rename ​====
  
-===== See Also =====+The option _Move_or_Rename_ 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](https://​forum.keyboardmaestro.com/​t/​how-to-move-all-files-in-a-specific-folder-and-replace/​9601) 
 + 
 +===== See Also =====
  
 === Actions === === Actions ===
Line 46: Line 63:
 * [[action:​New Folder|New Folder]] * [[action:​New Folder|New Folder]]
 * [[:​Actions|See all Actions]] * [[:​Actions|See all Actions]]
- 
----- 
  
 ==== Forum ==== ==== Forum ====
Line 53: Line 68:
 * [[https://​forum.keyboardmaestro.com/​t/​backup-to-usb/​3132/​7|Backup to usb]] * [[https://​forum.keyboardmaestro.com/​t/​backup-to-usb/​3132/​7|Backup to usb]]
 * [[https://​forum.keyboardmaestro.com/​t/​move-or-rename/​4518/​3|Move or Rename]] * [[https://​forum.keyboardmaestro.com/​t/​move-or-rename/​4518/​3|Move or Rename]]
- +* [How to move all files in a specific folder and replace](https://​forum.keyboardmaestro.com/​t/​how-to-move-all-files-in-a-specific-folder-and-replace/​9601) 
-* [[https://​forum.keyboardmaestro.com/​search?​q=Rename%20File|Keyboard Maestro Forum topics ​about Rename a File action]] +* [[https://​forum.keyboardmaestro.com/​search?​q=Rename%20File|Topics ​about Rename a File action]] 
-* [[https://​forum.keyboardmaestro.com/​search?​q=Trash%20File|Keyboard Maestro Forum topics ​about Trash File action]] +* [[https://​forum.keyboardmaestro.com/​search?​q=Trash%20File|Topics ​about Trash File action]]
- +
----+
  
 **Keywords: ** Create Folder, Move to Trash, Copy File, Copy Folder, Duplicate File, Reveal File, Reveal Folder, Move File, Move Folder **Keywords: ** Create Folder, Move to Trash, Copy File, Copy Folder, Duplicate File, Reveal File, Reveal Folder, Move File, Move Folder
action/File_Actions.1488765487.txt.gz · Last modified: 2017/03/05 20:58 by peternlewis