Focused Window triggers for Xcode not working

I'm trying to write a macro that fires whenever a 'focused' window changes in Xcode and it's not firing.

I have two different Xcode projects open, and I want to change the 'theme' dynamically when I switch back and forth between them.

The basic macro is:
TRIGGER: when focused window changes

  • AppleScript gets current_document_path of active workspace document
    if path is "Project 1" set theme "project 1"
    else "set theme project 2"

You get the idea..

the problem is the trigger never fires when I switch back and forth between two workspaces (that are both loaded).

See if the Interactive Help (Help ➤ Interactive Help), Something expected is not happening has anything useful to point out.

At the least, it should confirm that the macro is active and ready to be triggered.

I followed the steps, and everything checks out. I'm sure this should be pretty easy to reproduce.

Write this macro

Fire up Xcode, open two workspaces and cmd-~ between the windows

Notice that the macro does not fire. But if you move 'off' the window, and back on, it does fire.

Works fine here. If you have different Xcode versions, make sure the correct one is selected in the macro group.

Thanks for the reply.. good thought, and I do have different Xcode versions, and it's correctly selected in the macro group, this is additionally confirmed by the fact that the macro triggers if I switch from the app and back to it.

It could be the specific version of Xcode I'm using that's the issue, since it's an internal (Apple) version that's yet to be released there might be some issues with it still.