I tried finding an answer in the forums - apologies if I missed it.
I have a macro where I copy a bible reference from my current application (e.g. MultiMarkdown composer) and then invokes PocketBible to get the full text of the verse, put it on the clipboard and return me to the original application.
I do the application switching by saving the %CurrentApplication% token to a variable and then invoke the Use Variable - set front application by name. It works great unless the first (current) application is in Full Screen mode. Then it takes me the last used application that is not full screen. What am I doing wrong? Or is this not possible currently and I should avoid full screen mode?
You should post your macro, so we can test it.
How to Post/Upload Your Macro to the Forum
Also — how many windows do you have open in your full screen apps — and is there more than one window open to full-screen at a time?
The macOS does a lousy job of managing “Spaces” and doesn’t have an open API for them — so Peter can’t do much to automate them.
The existing apps that do this (AFAIK) do so through “hacking” the system.
I suspect your problem can be solved — even with full-screen apps/windows — but being able to test is imperative.
I’ve never heard of PocketBible. How long has it been around? I.e. is it safe to fool with?
Do you use the free or paid version?
Keyboard Maestro 8.0.4 “Full screen test copy” Macro
Full screen test copy.kmmacros (3.1 KB)
I stripped down my macro to a representative case. It isn't specific to PocketBible. To see the problem, open a TextEdit document, type a few lines of text into it. Now go into any other editor (I used BBEDIT), open a document, and invoke the macro. It will activate the textedit window and select all, and copy. It should then return to the other editor (BBEDIT in my case). If I paste, I will get the text that was in the Textedit window. So far so good.
Now make the editor where you originate the macro full screen (again, BBEDIT in my case). Invoke the macro. With this one I get an error message of Action Failed, Use Variable to Set Window by Name failed......
Is there another way to get this to work so that if I am in Full Screen from the invoking application, it will work? It's not a show stopper if I can't, I was just wondering if I was missing something.
I'm having a fairly good success rate getting a similar macro to work with apps in fullscreen mode (tested successfully with both BBEdit and Safari):
Full Screen Test.kmmacros (2.3 KB)
The key might be in using an "activate application" action instead of a "set front window" one. In a use case like this, you don't need to set a variable to get back to the original app; the "Activate Last Action" action takes care of that handily. Maybe try something like this and see if it makes any difference for you?
Thank you @gglick !!
That did the trick - it works perfectly now.