User Tools

Site Tools


collection:Finders_Selection

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
collection:Finders_Selection [2015/12/23 12:59]
ccstone
collection:Finders_Selection [2021/12/07 00:48] (current)
peternlewis
Line 1: Line 1:
 {{:​collection:​mac-finder-icon.png?​nolink|}} {{:​collection:​mac-finder-icon.png?​nolink|}}
 +
 ====== Working with the Finder Selection ====== ====== Working with the Finder Selection ======
 +
 **with the //​[[action:​For_Each|For Each Item]]// Action using the //​[[:​Collections|Finder'​s Selection Collection]]//​** **with the //​[[action:​For_Each|For Each Item]]// Action using the //​[[:​Collections|Finder'​s Selection Collection]]//​**
  
 As you probably know, you can select multiple files and/or folders in the Mac Finder, and then perform a manual operation on the entire selection, like copy, move, delete, apply tags, etc.  If you have an operation that you often perform, then Keyboard Maestro can most likely automate that for you. As you probably know, you can select multiple files and/or folders in the Mac Finder, and then perform a manual operation on the entire selection, like copy, move, delete, apply tags, etc.  If you have an operation that you often perform, then Keyboard Maestro can most likely automate that for you.
 +
 ===== Potential Use Cases ===== ===== Potential Use Cases =====
 +
 Some examples of Keyboard Maestro macros performing operations (actions) on a Finder Selection: Some examples of Keyboard Maestro macros performing operations (actions) on a Finder Selection:
   - Move the selected files to another folder you often use for a specific purpose   - Move the selected files to another folder you often use for a specific purpose
   - Assigning Mac Tags to the selection (can't be done via AppleScript)   - Assigning Mac Tags to the selection (can't be done via AppleScript)
   - Renaming the selected files using a consistent prefix and number scheme   - Renaming the selected files using a consistent prefix and number scheme
-  - [FIXME JM: should we add more?] 
  
-[FIXME ​ JM:  We need to put the detail examples in the same order as listed above. ​ Also, I suggest that we start with a simple example, like #1 above, that does NOT require something complicated like a plugin] 
- 
----- 
  
 ===== Setup of the For Each Item Action ===== ===== Setup of the For Each Item Action =====
Line 22: Line 22:
  
 {{:​collection:​km-for-each-finder.png?​nolink|}} {{:​collection:​km-for-each-finder.png?​nolink|}}
- 
----- 
  
 ===== Examples ===== ===== Examples =====
  
-**Here are some detailed examples.** \\  ​ 
 The //​Finder’s Selection collection//​ sets the //**For Each**// Variable to the full path of each file in the selection. The //​Finder’s Selection collection//​ sets the //**For Each**// Variable to the full path of each file in the selection.
  
 Note the consistency between the first three examples. And note that you could do all three in a single For Each action if you wanted (you would have to ensure the Move was done last of course, as that will change the path to the file). Note the consistency between the first three examples. And note that you could do all three in a single For Each action if you wanted (you would have to ensure the Move was done last of course, as that will change the path to the file).
- 
----- 
  
 ==== #1 - Move Selected Files ==== ==== #1 - Move Selected Files ====
  
-To move the files to the Documents folder, you would do this:\\n   +To move the files to the Documents folder, you would do this:\\ 
-[FIXME ​ **JM:  There is something wrong with these images. ​ They all have a "Fix Finder Selection Bug" checkbox on them that does NOT appear on my Actions, or in Chris'​s Actions.**] +{{ :​action:​move-to-documents.png?​516;nolink |}}
- +
-{{ :​action:​move-to-documents.png?​nolink |}} +
- +
- +
-----+
  
 ==== #2 - Assign Mac Tags to Selection ==== ==== #2 - Assign Mac Tags to Selection ====
  
 To change the Finder Tags, you would use: To change the Finder Tags, you would use:
- +{{ :​action:​change-tag.png?​516;nolink |}}
-[FIXME ​ **JM:  There is something wrong with these images. ​ They all have a "Fix Finder Selection Bug" checkbox on them that does NOT appear on my Actions, or in Chris'​s Actions.**] +
-{{ :​action:​change-tag.png?​nolink |}} +
- +
-----+
  
 ==== #3 - Rename Selected Files ==== ==== #3 - Rename Selected Files ====
  
 +You could rename the selected files from .txt to .html like this:
  
- +{{ :action:rename-selected.png?nolink&​516 ​|}}
-+
-Set the Finder Label to Red (using the Plug In action for Set the Finder Label). +
- +
-[FIXME ​ **JM:  There is something wrong with these images. ​ They all have a "Fix Finder Selection Bug" checkbox on them that does NOT appear on my Actions, or in Chris'​s Actions.**] +
-{{ :action:label-red.png?nolink |}} +
- +
-----+
  
 ==== #4.  Pass the File Path to a Shell Script ==== ==== #4.  Pass the File Path to a Shell Script ====
Line 69: Line 49:
 You can pass each file to a shell script using something like this: You can pass each file to a shell script using something like this:
  
-{{ :​action:​pass-to-shell.png?​nolink |}} +{{ :​action:​pass-to-shell.png?​516;nolink |}}
- +
-----+
  
 ==== #5.  Combining Multiple Actions in One For Each Item Action ==== ==== #5.  Combining Multiple Actions in One For Each Item Action ====
- 
  
 This macro will take the selected items in the Finder and perform the following Actions: This macro will take the selected items in the Finder and perform the following Actions:
Line 89: Line 66:
 {{ :​collection:​working-with-the-finder-selection.png?​nolink |}} {{ :​collection:​working-with-the-finder-selection.png?​nolink |}}
  
----- 
 ===== Downloads ==== ===== Downloads ====
 +
   - {{:​collection:​finder_rename_and_sequentially_number_selected_items.kmmacros|}}   - {{:​collection:​finder_rename_and_sequentially_number_selected_items.kmmacros|}}
  
----- 
 ===== See Also ===== ===== See Also =====
-==== Documentation ==== 
  
-  ​TBD+==== Actions ==== 
 + 
 +[[action:​For_Each|For Each]] action 
 +* [[action:​File_Actions|File Actions]] action 
 +* [[action:​Get_File_Attribute|Get File Attribute]] action 
 +* [[action:​Set_File_Attribute|Set File Attribute]] action 
 + 
 +==== Collections ==== 
 + 
 +* [[collection:​Finders_Selection|Finders Selection]] collection 
 +* [[collection:​Folder_Contents|Folder Contents]] collection 
 +* [[collection:​Mounted_Volumes|Mounted Volumes]] collection 
 + 
 +==== Tokens==== 
 + 
 +* [[token:​FinderInsertionLocation|%FinderInsertionLocation%]] token 
 +* [[token:​FinderSelection|%FinderSelection%]] token 
 +* [[token:​FinderSelections|%FinderSelections%]] token
  
 ==== Forum ==== ==== Forum ====
 +
   * [Working with the Finder Selection](https://​forum.keyboardmaestro.com/​t/​working-with-the-finder-selection/​278)   * [Working with the Finder Selection](https://​forum.keyboardmaestro.com/​t/​working-with-the-finder-selection/​278)
  
-==== External References ==== 
-  * TBD 
collection/Finders_Selection.1450893554.txt.gz · Last modified: 2015/12/23 12:59 by ccstone