Can't figure out how to use enhanced applets

I am keen on making my applet an “enhanced applet”. In particular, I would like a functioning “About” box, “Quit” menu item and “Help” menu. The UI is created with DTP v1.1.3 and default “display dialogs”. It does not have “on run”, “on quit”, “on open” handlers. Quit is handled specifically by code. The applet is not stay-open and is not a droplet.

I have done some trial work but, encountered a lot of problems. All I’ve done is just save my applet in enhanced format. So, I have some questions:

  • “Quit” menu item is greyed out. Is there a way to make it useable ?
  • “About” box displays and the close button is red but inactive (i.e. mouse-over does not show the “x”), unless a sheet is visible. Is there a way to make the close button work ?
  • If the “About” box is showing and the applet shows another DTP dialog, the “About” box close button becomes greyed out. Choosing App=>About makes that button red again but still inactive. I don’t understand any of that.
  • I don’t understand the dialog “sheets”. What functionality do they add ?
  • Can “sheets” be hidden/suppressed ?
  • Can sheets be made to close with the dialog ? They remain visible with “Stop” button greyed and the progress indicator cycling back and forward.
  • What is the purpose of the “Stop” button in sheets ?

Also, command-h does not hide the applet but makes it inactive BUT, App Menu => Hide works. This behaviour started with macOS 13 but I had hopes it would be fixed by the enhanced applet format.

Is there documentation that might help with these questions ?

Thanks.

Garry

Have you had a look at this:

Yes, thanks, I have read that. I’ve also gone through the material in SD8 Help.

Maybe I’m a bit dim, but I just don’t understand the intention. I can see in the gif animation that there is a sheet (?) underneath the “file dropped” dialog. Are enhanced applets intended only for droplets ? Otherwise, is it possible to suppress the sheet and make the Quit menu item functional ?

I reckon that some of the behaviour I get (reported by my Q’s above) is due to using the Dialog Toolkit. I’ve been hoping the enhanced applet format would be a workaround that but, maybe it’s not.

Cheers.

No, but a better droplet UI was one of the primary aims. Given what else your app does, I don’t really think it’s a good fit for you.

Shane, many thanks. I’ll ask a new question sometime on how to enable the Help menu in an applet.

I’m pretty sure it’s been answered somewhere here already. You need to create an action handler, and at launch set it as the action of the Help menu item.

Yes, some years ago, you advised on how to implement a help button in a DTP alert [Help button in Alerts].

I tried but, couldn’t make it work so gave up. I do have a Help button which just opens a pdf file. I’d like to remove the Help button and use the Help menu.

I’m not sure I know what an action handler is nor how to make the Help menu visible so that it can respond to anything. A problem for another day.

Success for today was to finally succeed in getting a functioning minimize button onto a DTP enhanced window. It took 18 months for me to realise that 1<<2 is not a range between 1 and 2 but is actually a “logical left shift” which reads as 1 * 2^2 i.e. =4. I’m sure there is a reason why Apple’s Developer documentation on NSWindowStyleMaskMiniaturizable uses that algorithm instead of just saying “4”.

Script debugger has a function for that: it’s called code Completion (see the edit menu).
Press F5 while selecting the enumeration. SD will display its number value like this:
capture 001

I faced this today, too.
My new little applet which use enhanced applet format and can not quit itself by using quit command (tell me to quit).

So, I found I had to use Apple Genuine applet format…

Jonas Whale,

Many thanks. Code completion looks useful. I’ve seen it but, misunderstood it. For example, pressing Esc twice deletes any highlighted code. Sometimes, I’ve not noticed what happened and then had syntax errors etc. requiring command-z to get back what I accidentally deleted. So, I try to avoid the Esc key and hence avoid code completion.

Piyomaru,

In the Apple applet format, did you manage to make the Quit menu item active ?