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

Thanks. I will.

I've never tried Alt-Tab, but I do have Witch and Contexts, and I personally much prefer the latter, so I'd suggest giving that a shot, too.

1 Like

Thanks. I'll take a look.

Which I still haven't had time to explore. I intend to ...

This thread has gotten sidetracked into some very useful discussions of how to list and choose windows, but it started out being about how to create a minimal window, one that consisted of a titlebar only.

I tried try creating a minimal window with Custom HTML Prompt, stripping the HTML down to this:
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>
</body>
</html>

But that gave me a window 215 px high (approx).
image

I can't seem to get the window any shorter. Even with some JavaScript on a W3C window resize test page, I could not get any window shorter than about 150 px, even if specified 50 px.

What I asked for in the OP (admittedly not very clearly) is a window that consists only of a titlebar, about 20-22 px high.

This would allow me to position the window behind the status bar so that when I type the hotkey for it and it becomes the front window, changing Desktops in the process, it won't matter if it's theoretically in front of other windows because it won't be visible.

Is there an HTML setting that will make the body disappear? If not, then maybe using Custom HTML Prompt is not the answer.

Is this going to take Objective-C, or what? Can AppleScript somehow make a window 22px high? Can JavaScript?

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.