Display Alert in Enhanced Applet

Hello,

is there a way to avoid bringing the enhanced applet to front when calling display alert?

No, there is no way of avoiding it.

Okay, thanks for the quick reply. Thus, I tried it with Dialog Toolkit and it works as expected (only a jumping dock icon). So I’m happy now. :smiley:

Ironically I do not like the bouncing icon and wanted it to always come to the front using Enhanced Applet and the reverse answer to this Is to add the following two lines before you call display enhanced dialog.

--Move to frontmost (By edama2)
current application's NSApplication's sharedApplication()'s setActivationPolicy:(current application's NSApplicationActivationPolicyRegular)
current application's NSApp's activateIgnoringOtherApps:(true)

Credit to edama2 through Takaaki Naganoya’s awesome AppleScript blog site:
http://piyocast.com/

1 Like

Thanks. What’s the difference to tell me to activate?

Any hints what the error “User interaction disallowed” could mean? I get it sometimes instead of the enhanced alert.

One works the other doesn’t. It might work if you tell your app name to activate but my app calls scripts to run so it didn’t always work. This is fail proof.