How to Bring Floating Window Only (Not the App) to the Front

Using Scrivener, I created a utility which allows me to take notes on the fly when I am in other apps. The utility is basically a custom make Scrivener file which is a floating window.

My last step is to use Keyboard Maestro to open / close the utility using a bring to the front and hide window actions and a global keyboard shortcut.

The macro is incomplete. As soon as I get the bring window to front action to work, I will add an if then else action to toggle show hide,

My problem is that when I bring the floating window to the front, the window does come to the front which is great, but also the Scrivener app with all its open tabs.

How can I bring only the floating window with the name Scratchpad based on AmberV to the front without showing the Scrivener app itself?

I tried adding the hide Scrivener action but it hide all Scrivener windows including the floating window

Thank you !

First draft

Second draft

Hey @ronald,

As far as I know there is NO way to do this...

-Chris

1 Like

thank you very much Chris

1 Like

maybe create a custom HTML prompt that quickly copy-pastes into Scrivener, then hides it?

1 Like

Thank you again @ccstone and @hello

I did some testing and found a simple solution which works for individual apps, and which I would like to generalize to all apps, and thus create a macro and shortcut in the global macro group.

At the present time:

  • if I am in DevonThink → open my floating Scrivener scratchpad (open file + floating window menu action) → I simply add an action to show DevonThink , and presto it works perfeclty and I have what I want, ie access to my sophisticated scratchpad while working in DevonThink

  • if I am in Chrome → open my floating Scrivener scratchpad (open file + floating window menu action) → I simply add an action to show Chrome , and presto it works perfeclty and I have what I want, ie access to my sophisticated scratchpad while working in Chrome

and so on and so forth, using Numbers, Safari etc etc etc

The only remaining problem is that I have to write a different macro for each app I am working in.

Is it conceivable to create a macro which would

  • start by identifying which app (or window) I am in, let's call it “AppX” (put the name of the app in a variable?)
  • open my scratchpad with floating window (I can do this)
  • Show AppX (simply the show application action below or a show window action)

thanks again very much

image

@ccstone @hello

After a lot of testing as suggested by @ccstone I was able to solve the problem simply by ending the macro with

2 Likes

Glad that worked.

You could also use a Switch, and use a ‘Application%1’ for defining more than one app, so it activates each app accordingly.
Sounds confusing but is miles better than a ton of nested Ifs.

1 Like

thank you. Switch is a good idea when using variables.

There are 3 issues:

  • although there are many apps, they have in common that they are all the last app activated. Hence, they are all covered by the simple last Activate Last App action.

  • in a parallel discussion pertaining to application and window variables, I solved this problem.
    Store currently active application in a variable? - #7 by ronald

  • the different methods may see identical in terms of outcome, but they are not. There is a question of placing the cursor in the correct place at the end

By the way, I always very much enjoy your comments and original thinking

1 Like

Thanks @ronald!
Eagerly awaiting your book/novel!

1 Like

The book: I am going through an existential crisis. Is a book worth it in a world with such an overabundance of texts of all kinds.

1 Like

Must be hard to complete a full book. Seems like a tall mountain

is it my imagination or has your understanding of keyboard maestro progressed at a very rapid rate in the past year or two ?

I'd say it's the same, I just keep asking lots of questions, and 𝚜̶𝚝̶𝚎̶𝚊̶𝚕̶𝚒̶𝚗̶𝚐̶ repurposing code from here and there :slight_smile:

1 Like