I have a simple script that gets the path (target) of the front Finder window. The result is something like:
folder “Default Folder” of folder “Logic” of folder “Music” of folder “polyvox” of folder “Users” of startup disk of application “Finder”
I want to be able to convert that target result (file path) to a format that features “slashes”, e.g.
/Volumes/Macintosh HD/Users/polyvox/Music/Logic/Default Folder
(Interesting, the above two examples don’t quite match up; I wonder why?)
The “slashes” format is one I believe I can use in a SAVE FILE AS window using SHIFT-COMMAND-G (which apparently is supposed to work in any application’s SAVE FILE or SAVE FILE AS window).
My ultimate purpose is to be able to create a new target folder within a given default folder one level up, all while in the process of saving a file. In other words, I have a “default” folder which I am constantly populating with new sub-folders (giving each a new name). Into each new sub-folder I am saving a new file which I have just created.
So the sequence of events in the macro will go like this: with a hot-key trigger I choose to save a file. The SAVE FILE window appears but with the wrong destination folder chosen. Using SHIFT-COMMAND-G (or some equivalent?) I direct the destination to a specific default folder:
/Volumes/Macintosh HD/Users/polyvox/Music/Logic/Default Folder
Once this is established, I create a new folder within that default folder. This then becomes the destination folder for the SAVE:
/Volumes/Macintosh HD/Users/polyvox/Music/Logic/Default Folder/New Folder
Aaaannnnd SAVE. Bingo. End of macro.
I would even be happy, though, if the macro would be triggered once I have already navigated to the SAVE FILE window.
I suppose this subject really involves two separate goals: converting a target format and then directing a save to the correct destination. But these two goals are related, wouldn’t you say?
Many thanks for any help in this endeavor.
Model: Mac Pro
AppleScript: 2.7
Browser: Safari 13.1.1
Operating System: macOS 10.14