Open Document Action: Pointing to Alias

Hi, I'd like to create a macro that will open a document, and that document will change each week. My hope was to point to an alias and then update the alias each week. But it doesn't look like I can point to a symlink -- resolves into the underlying doc. Is there another way to achieve this dynamic reference?

Can I ask why you would not just point to the original file through Keyboard Maestro? I just tried pasting in the path to a symlink file in Keyboard Maestro and it automatically resolved the path and opened the original file. Is that not what a symlink would do anyway?

Sorry if I have misunderstood what you want to achieve.

1 Like

Yes, this can be done, but I would not do it using file alias or symlink.
Creating these requires too many steps.

I would just use two macros:

  1. Macro #1 would set the path to the target document to a KM Global Variable, using the KM Action Prompt for File.
  2. Macro #1 would open the file in the above KM Global Variable.

You could even make this with one Macro, but with an option that uses long press key to set the KM Variable containing the path.
See MACRO: Trigger Option Using Long Press of HotKey [Example].

Hi, The point of using the alias is that it makes it easier to change the target file. Each week, I create a new file for which I want a keystroke shortcut -- control + shift + h or some string of characters, etc. Rather than updating the macro each week, would be easier for my workflow to update the alias in Finder.

Seems like there isn't a way to do this based on responses so far.

Thank you for the suggestion but I'd like to avoid prompts. This is a brain-dead keystroke trigger that opens the file each time-- I don't want the cognitive load of then thinking what that file is named.

So... what you want is to easily assign the same keystroke to open a different file each week... the whole alias thing might be a distraction from coming up with a solution in Keyboard Maestro to assign an existing keystroke to opening new files.

If you could just click on the new file and assign it to the new keystroke, would that work for you? Don't instantly know how to do that but feels like it should be possible with Keyboard Maestro.

And to answer my own musings... renaming the "old" file and and labelling the "new" file the default name will achieve this. Keyboard Maestro's Open File action will open the new file rather than the old - so, your existing shortcut will open the current file and no need for prompts.

Again, apologies if I am missing something here :slight_smile:

The AppleScript code from the last post of this Stack Exchange thread, with one small tweak—replace reveal with open—works with an alias file and could be used with the Keyboard Maestro action to Execute An AppleScript.


set myFile to "/Path/To/File.ext" as «class furl»

tell application "Finder"
	open myFile
end tell

Thank you for the thoughts-- I think this would work but my workflow works better with aliasing. It feels more automatic to me.

This is great and did the trick -- thank you!