How Can I Create a Series of Minimal App Windows That Only Consist of a Titlebar?

Read the help on the action.

Specify the attributes (like without a title) in the Gear menu, and specify the height and width of the window (several ways, but by setting the body attributes data-kmwidth and data-kmheight is easy).

image

image

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<title>Custom HTML Prompt Example Testing</title>
	<style type="text/css"> 
body {
    max-height: 10px;
    margin: 0;
}
	</style> 
</head>
<body data-kmwidth="50" data-kmheight="25">
Hello
</body>
</html>

@August Just to let you know @gglick is completely right!

I just tried „Context 3“. This is really ... hard to top. In fact it's so good, fast and customizable that I'm really considering using different desktops, which I never wanted to do :joy:

Thanks @gglick I did not know "Context".

1 Like

Nope, not that. "Prompt With List" is happy to fix my dire coding for me, and won't display blanks lines as potential choices.

The problem's in the second AppleScript. It uses the repeat structure to easily handle a multiple-selection return from "Prompt..." but, for whatever reason, there seems to be one more paragraph than the number of items selected in the "Prompt..." action.

Not exactly important though, as this is more a demo to give @August ideas than it is a production-ready macro!

Wow! Thanks Peter.

With the following line in the HTML that you shared (and removing the "Hello"):

<body data-kmwidth="400" data-kmheight="2">

I got this window:
image

The body space under the title is the 2px that I specified.

I have more questions, of course, like how to set the values of <title>, data-kmwidth and data-kmheight using variables, how to control where in the screen it appears, etc. I also have to test, as discussed above in subthreads, if I can list the window as being a window on this particular desktop, if I can move the windows to other desktops, etc., etc.

This is a great start on the idea of having my DTWSID window as small as possible, or even invisible.

Thank you!

1 Like

These are covered in the Custom HTML Prompt action help.

The values are calculation expressions.

See:

<body data-kmwindow="SCREEN(Main,Left,20%),SCREEN(Main,Top,20%),420,560">

Which will place and size the window, and can use variables.

1 Like

Ah... I get you. No, I suppose it may not be important, but it's precisely the type of niggling problem that I would obsess until I either found the cause or lose my shit.

Are we about to meet on an edition of "Long Lost Brother" or something? :slight_smile:

Normally I'm the same, but I've enough of that at work at the moment so I let it slide (for now...).

1 Like

BFAM (Brother from Another Mother)?  :sunglasses:

2 Likes

Thanks Peter (@peternlewis),

I'm running into some strange little glitches with the Custom HTML Prompt windows that suggest to me they are not as stable as I need. I wish I could mark the question Solved, but I did specify in the OP that I needed the windows to be in different Desktop Workspaces. That's where the Custom HTML Prompt (CHP) windows seem to have trouble.

When I create three windows with the above CHP code, they appear in the current Desktop. That's fine. But when I attempt to move one of them to another desktop, the other two CHP windows move with it. I cannot move the different CHP windows to different Desktops. Not critical, but foreboding.

I can create CHP windows in different Desktops by moving to the desired Desktop Workspace first and then creating the CHP window. However, as before, they don't like being moved between Desktops. In this situation, when I move a CHP window to another Desktop that already contains a CHP window, it initially looks OK, but it turns out that all the other CHP windows in other Desktops disappear, leaving only the two that are visible in the destination Desktop (the one created there and the one moved there).

I'm encouraged by being able to create CHP windows on every desktop; I might indeed be able to use them as the DTWSIDs that I desire. And if I hide them under the Status Bar by positioning them at Y=1, there would be no risk of them being accidentally moved and breaking the whole system.

But they also seem fragile. The above behavior has me concerned that if I have a CHP window "permanently" on every desktop, it might interfere with being able to use CHPs in KBM for any other purpose. As I said above about Alt-Tab, it's much too useful a tool to dedicate it to only being able to be used in this system. So I have to test that further.

They sound like Desktop behaviour issues, and unfortunately I can't do anything about how Desktop behaves.

I'm going to treat this thread as having solved my question in the OP. Thanks, Peter!

I need more help making this work in my particular situation, and I'll make those questions into separate forum topics.

1 Like

Well, I've removed the "Solved" marker on this thread because HTML Prompts come very close, but fall short of what I need in two key respects:

  • I haven't found a way yet to list all the titles of the HTML Prompt windows
  • and beyond that, I haven't found a way to activate a specific HTML Prompt window by its title.

Without those two functions, HTML Prompts, although esthetically pleasing in many respects, are not going to serve my needs.

The whole point is to have one window in each Desktop Workspace, be able to list those windows, and then activate that window to get the OS to switch Desktop Workspaces.

My current thinking, among many possibilities, is to pick a browser app that I dedicate for this purpose. It could even be an off-line-only HTML viewer since it would never need to download pages.

Any suggestions?

It seems this problem is being worked on in Dan's thread Find a Stray Custom HTML Prompt Across Multiple Desktops?

@DanThomas?

Yes, and I have it worked out. Check out Find a Stray Custom HTML Prompt Across Multiple Desktops? - #13 by DanThomas. Let me know if you need more information.

Please let me know if I understand that thread correctly. You have to step through every single desktop and look for KBM windows in each desktop. There is no way to generate a list of all open windows, such as can be done with Finder or TextEdit.

How long does that take? Do you have to sit and watch it switch from window to window to window? I am looking for something that can be used as my window switcher, while I am working. (And I am currently trying out using 40 desktops.)

You crazy, man...  :sunglasses:

Keyboard Maestro is not the tool for this job.

People have recommended some other apps to you, and I suggest you look into them.

If you really want to pursue the KM angle then I've mentioned the AppleScriptObjC code that @CJK came up with to query the window manager.

That doesn't get you where you want, but it's a starting point. Take it and run over to the Script Debugger Forum and see if someone there can help.

I expected that 32 would be the max, 16 in each monitor, 31 on the laptop running without an external monitor. When I discovered that I could go past that, I stopped at 40 for experimental purposes (41 in two monitors).

If I can make something that scales to 40, then it should handle 20 easily. Having to physically switch to each and every desktop to find a desktop by name is not practical.

I can put a TextEdit window in each Desktop or a Notes window, or Finder or a lot of things, and I can quickly switch to that Desktop by activating the window by name from an easily accessible list. But I use TextEdit and Notes and Finder a lot.

So I've been expecting that would have to dedicate some unused but minimally functional app to this purpose.

It started to look like KBM's HTML Prompt could do it, but that turns out to have been wishful thinking. It could generate the ideal geometry window, but it can't list all open windows by title. And its not good about windows being moved from Desktop to Desktop. I haven't yet tried building a script that creates an HTML Prompt window on multiple Desktops, but when I create multiple windows on one desktop and try to move one of them to another Desktop, all the other HTML Prompt windows come along with it. That suggests that part of the listing problem is that they are not really separate windows.

I suppose I could build my own app (theoretically, I'm not that app builder, yet) that has no other purpose than to display a title and list all the titles of all windows -- provided that it could also do what TE and Finder and Notes can do, but a lot of apps can't, and that's have each window stay in its original desktop through a reboot. That's the original question in this thread, an app that is only a titlebar where I can list the titles and which hopefully stays on its Desktop when rebooting.

Thanks for the reminder about the Script Debugger Forum. Maybe I should post the question on Ask Different or Stack Exchange too. All the "build your own app" tutorials that I have found don't go near the topics that I need.

And then there's AltTab, Which, and Contexts, mentioned above. AltTab isn't what I need, for reasons described in item #32 above, but the others might get me there, I haven't looked yet.

Again, thanks to everyone for thinking about this.

@gglick @Frankb
Hi Gabe, hi Frank,

Do you have a link for Which? Googling for it, I've been unable to come up with search terms that don't just offer to tell me which apps I have on my Mac.

sure, here is
Witch

the other link is in the text from gglick
I do have Witch and Contexts,