I had this issue before and today I found a way to achieve this, thanks to @ccstone's post
So basically if we set the notifications to Banner
Then the Text Briefly action, is indeed briefly shown as expected.
Now the issue is that the Notification action will also be displayed briefly.
Using the Execute AppleScript action with the script provided by @ccstone
display notification "They're coming to take you away – Ha, Ha!" with title "Keyboard Maestro" subtitle "Is sending you a message" sound name "Tink"
we are able to have both notifications and banners.
So my question to @peternlewis is:
wouldn't it be possible to implement this as an action?
Like a "wrapper" where the action's UI is like the current Notification action, but what it's doing is running the above AppleScript?
That way we can have it set to Banners in the notifications window, but we would be able to have both options, which is useful.
The only thing that can't seem to be customizable is the icon, but that's not an issue to me. Having both options is more important
I don't know what the benefit of Text Briefly over a notification is, although that's by the by.
You could make a KM plugin that does this if you'd like. It's a bit convoluted but it's doable.
I've made a start but, having only ever made two plugins, my inexperience is showing and I can't get it to import. Perhaps someone else can see what I've done wrong...? I probably would have been able to get it working a few weeks ago, when plugins were fresh in my mind. Oh well...
The only issue now is that the sound doesn't work, even if I explicitly name it in the .scpt file.
Ok thanks. Just odd that it doesn't look like the others. Maybe because they were generated by Script Editor rather than BBEdit?
As a more general point about plugins: They're very neat and handy, but I generally try not to use them in case I need to share the containing macro and forget to also send the plugin. I wonder if there's a practicable solution for that problem?
Mini-feature-request: when you export an action, it would be really nice if the subsequent save dialog was pre-filled with its actual name, rather than a generic one.
AppleScript scripts can be distributed publicly as either plain text files or compiled script files. When the author of an AppleScript doesn't want others to see how the script works, then they'll compile their text script as a run-only file which will prevent others easily seeing how the script works. The other (potential) benefit of compiling scripts is that they may run a bit faster than their plain-text counterparts (I know you have an interest in that).
That's why you can't read your compiled run-only script in any editor.
There are currently just two chances of that happening - big and fat (apologies to everyone who I might have offended...)
that's correct, and the places you can compile AppleScript are in an AS editor or through a shell command.
You can't compile AS in a text editor like BBEdit or TextEdit is because they don't understand AppleScript and because they don't understand it they also can't display compiled AppleScript. Obviously Script Editor, Script Debugger, QuickView do understand AppleScript and so they can display it...
(Side note: For some reason unknown to me I don't have QuickView on my Mac so I'm just assuming it's a bit more intelligent than BBEdit/TextEdit in this respect.)
The file you uploaded (17.2 KB) I can open in both SD and SE, so I can safely say it isn't a run-only version. Here's a run-only version of that script:
The difference between the text and compiled versions of an AppleScript is that the latter has been converted into bytecode and also retains most of the human-readable script. The former can't actually be executed until it has first been converted into bytecode so that's one reason a compiled script will start executing quicker than a plain text one. That also explains why you can display a compiled script in a suitable editor and it appears as human-readable.
A run-only version of a script is both compiled and stripped of its human-readable content, which is why you can't read it nor edit it.
Does this answer the question? - I think so but I'm not really 100%!
This section from an O'Reilly book gives some insight by the way: