Naming (Or Numbering) and Activating Windows Dynamically

Hey Amelio,

Can it be done? Yes.

Can it be done robustly? Good question.

I think you might want to take a look at Hook, but I don't use it and can't really say it's in the ballpark of what you want.

You can create Keyboard Maestro macros with AppleScript, so it's easy enough to assign an activate-app ⇢ activate window sequence to a macro and give it a keyboard shortcut.

Here's the basics of how to create such a macro on the fly:

It will take some adapting to fit your use-case though.

The big trick you run into is allowing for changes in your set-up.

For instance – you've assigned a bookmark to a web page in Google Chrome, but then you monkey with that window and change the tab order.

I think I would take a different approach.

Save a Bookmark to a Global Variable:

Window Bookmarks ⇢ Save 1.00.kmmacros (6.1 KB)

Retrieve a Bookmarked Window:

Window Bookmarks ⇢ Retrieve 1.00.kmmacros (12 KB)

These work but I haven't spent any time trying to make them bombproof.

I've prefixed each line in the bookmark file with a number for easy access.

If the given window is not found Keyboard Maestro will throw an error notification, but it will still activate the given app.

If the app is not running it will be launched.

-Chris