BernSh
January 26, 2021, 12:58pm
27
It's interesting. Yours opens a dialog a bit faster than the AS Chris wrote and is MUCH slower to execute the the actual move which is very fast using the AS.
Also, the AS opens a dialog with an add folder button present and I know you could modify your macro to provide the same.
Good stuff and thank you for providing it and all the structure around it!
Relatedly, I've come across several takes on filing actions. It seems that Filing/Moving files could be a section or topic onto itself within the Forum and might serve as an initial way of organizing Forum materials to present an inroad for learning KM. A bit of continuing Making KM More Accessible for Non-Geeks - #43 by peternlewis
Following are only some pieces that could be included in this topic. This is just a sketch from a beginner's view of this idea and is undoubtedly off in many ways, including putting in this article.
Getting Started
Straight filing files~
I can send cmd + c keystroke followed by cmd + delete and then I am stuck. There is a Move or Rename a File action and I suppose I have to put my copied file/s to some clipboard and pass that to it or is there a better way?
Thank you for any help.
Yes, it can, although using TextEdit as opposed to a plain text editor like BBEdit does complicate things a bit for the macro since it uses RTF for its default format. It is definitely possible, though. For formatting, each destination folder needs to be on its own line, and if you want the prompt to show something other than the folder path, like a custom name, you will need to follow @roosterboy 's advice and append the name to the file path with two underscores, like this:
~/Documents/Import…
As I just replied in your other post, see:
MACRO: Transfer Files Between Folders [Example]
~~~ VER: 2.0 2018-03-12 ~~~
DOWNLOAD:
Transfer Files Between Folders [Example].kmmacros (41 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.
Please feel free to post below with any questions/issues/suggestions.
This Macro Provides
Selection of Source and Destination Folders
Folders can have default selection based on selection in Finder
Prompt to Confirm continue of macro, showing folders
…
Variations while Moving files~
Hey folks. I've got an idea for a macro I'd like to try, but haven't quite figured out how to pull it off. When I'm working on a project (in my case, I do film scoring, so each project is movie), I have the same folder hierarchy set up everytime, just with the current project name at the top. When I've finished my individual music cues in Digital Performer, I export those files to an Mixes folder that then gets sent to the places it needs to go.
For each movie it's always the same place, so I…
I often find that I want to move the selected file(s)/folder(s) to their parent directory.
I wasn't sure how to best do this, so I did what I always do, I wrote a shell script that checks to make sure the same file(s)/folder(s) don't exist in the parent directory, and then moves them.
This is designed to be used in a group that is only active in Finder.app:
Download: Finder - Move to Parent Folder.kmmacros (38 KB)
[image]
OK folks, now I get to offer something constructive. Passing this on in case It helps. I wanted to know how to move a file using Finder. It turns out that you can use a keystroke which is far easier than writing a script.
I am working on a project which requires reviewing a large number of documents then moving relevant found documents to my project folder while I put together a final PDF for project output. To do this I need to figure a way to keep all my files where they are parked, then to p…
I haven’t used Keyboard Maestro for a while. Basically I just want to copy a file from my iMac to a Mac Mini that has been triggered by a hot key. The file exists in the new location so will I have to delete that first and then copy it over?
So let me start by declaring I'm a Keyboard Maestro newbie, and this is my first post. Hello all!
I'm trying to figure out how to take a currently selected file or folder and trigger a macro to ideally automate:
Creating a new folder in the same location as the selected file or folder.
Moving the selected file or folder inside the new folder.
Renaming this new folder with the originally selected file or folder name, leaving me with an ability to edit the new folder name before committing it.
…
Use Case
Provide an easy way to search/filter the list of files in a folder
Allows user to use incremental search with autocomplete to search/filter a list of files in a selected folder
User will be Prompted to Select the Target Folder
Example Output
[Demo-My-Macro-Choose-File-AN]
Revised to exclude invisible files, and to sort files alphabetically
[image]
Below is just an example written in response to your request. You will need to use as an example and/or change to meet your workf…
Parts involved with Moving Files~
Pathways-
Hey Folks,
Anyone working with shell scripts often needs to grab a Posix path or three from item(s) in the Finder. Here's a simple macro to do just that.
Finder-Selection { Get Paths ~:… If Possible }.kmmacros (4.0 KB)
[image]
Example Result:
[image]
It's good practice to use home-directory-anchored paths when possible, because they are more likely to survive a change in hard-drive-name, user-name, or a move to a different computer.
Many years ago I predominantly used hard-coded-paths, …
Hey Folks,
Sometimes you need the POSIX Path of a document that's open in an application.
Sometimes that's available via the app's native sdef (AppleScript Dictionary), but unfortunately not all apps are natively AppleScriptable.
AppleScript, System Events, and UI-Scripting to the rescue – the macro below will grab the POSIX Path of the frontmost document open in most applications.
-Chris
Acquire POSIX Path of File Associated with Front Window of Front Application.kmmacros (7.7 KB)
[imag…
In Keyboard Maestro, you work with the Finder Selection by using the For Each action to iterate over the selected files. From there, you can do whatever you would like with the files using the various file actions, or by processing with a script or other means. There is a smart action in the acton selector for For Each Path in the Finder Selection, which is simply a For Each action, preset to iterate through the Finder Selection collection. You can put whatever actions you like within that ac…
I would like to get the path of a file selected in Finder.
I have seen the post . When I use it, it provides both the path and filename.
An internet produces some AppleScript such as:
tell application "Path Finder" to get POSIX path of (item 1 of (get selection))
But this also produces path and filename.
Is there a simple way to amend the AppleScript or the macro that Peter provided in his post to just get the filename alone?
I've used a Services extension to copy the path of the Finder selection for eons, so I never noticed it is not installed by default in OS X. I received a recent support question asking for this, so here is the resulting macro.
Select a file in the Finder, and then select Copy Path from the Keyboard Maestro status menu and the selection's POSIX path is copied tot he clipboard. If you select more than one, then they are copies as multiple lines (if its only one, there are no return characters), …
I would like to get the path of a file selected in Finder.
I have seen the post . When I use it, it provides both the path and filename.
An internet produces some AppleScript such as:
tell application "Path Finder" to get POSIX path of (item 1 of (get selection))
But this also produces path and filename.
Is there a simple way to amend the AppleScript or the macro that Peter provided in his post to just get the filename alone?
I searched and cannot find an answer to this. The nearest I came was: [File Paths Not Working, Why? ](http://this post). That post was about writing out the file path apparently, not clicking on a file and creating the path with correct formatting (escaping the spaces).
I use an app regularly that has been having inconsistencies in dragged in file or folder paths. It may be fixed soon (or not). I am wondering how to set up a macro from either a right click or a keystroke where I can copy the fil…
The Clipboard-
Continuing the discussion from Working with the Finder Selection :
Is there a way to copy a pdf at a file path into a Keyboard Maestro clipboard so I can paste it in to an email in Apple Mail? I command+c the file and command+p which of course work in the Finder and then Apple Mail. The file is the same
This post is so old - but I can't get this to work now? Same kind of idea except I want a new file added to a folder to be added to the clipboard, so I can paste it into Mail or Skype or Slack or wherever else. Any tips would be great - sorry for what must be a very simple question - I have lots of macros for things but just can't figure this one out!
Hey Folks,
Here’s how to put a reference to one or more files and/or folders onto the clipboard.
These files and/or folders may then be pasted anywhere the macOS will allow, such as in the Finder, Apple Mail, etc.
-Chris
----------------------------------------------------------------
# Auth: Christopher Stone { Heavy Lifting by Shane Stanley }
# dCre: 2018/04/10 16:57
# dMod: 2018/04/19 14:42
# Appl: AppleScriptObjC
# Task: Place a reference to one or more files and/or folders on the clipbo…
Dialogs-
I would like to create a macro that would let me press a key to set the current location of an open/save dialog screen to the frontmost Finder window. Bonus points for tips on a macro that can set the location of the open/save dialog to the second frontmost Finder window, and so on.
I realize that I can just drag the little folder icon of a given finder window into an open/save dialog, but that involves a LOT of clicking and dragging as you have to be able to see both the finder window and the…
Making Folders-
Use Case
As some of you may be aware, the Finder already offers a similar feature. While it works OK, this macro offers the following:
A prompt to enter the folder name, which you can cancel.
Tests for a folder already existing by the same name, and gives you an opportunity to cancel or overwrite.
So this macro may, or may not, be a benefit to you over the Finder feature. You can choose.
MACRO: Create New FOLDER in Current @Finder Folder
--- VER: 1.2.1 2022/02/18 ---
DOWNLOAD:
Cr…
Group to Folder
by Ian Kirkland
Description
Of all the actions I've created, this is probably among my most-used and – truth be told – favorites. The action groups selected Finder items into a new folder with the name defined in the action's field.
You're probably wondering, "Why not use the grouping functionality already built into Finder's menu?" Good question! Here's why: If you use a project-based organizational scheme or even a mildly-OCD-driven folder hierarchy, you've like…
Links-
What for?
Many text-handling programs allow you to drag (or paste) a file into their text field, in order to create a file URL that points to that file.
The problem with this is: Unlike Finder Aliases, file URLs are fragile. They behave like absolute symlinks, that is, they immediately break if you do one of the following:
Modify the file name
Move it to another folder
Modify the name of any of the file’s parent folders
Move any of the file’s parent folders
The macro facilitates you to creat…