I can also confirm that AppleScript execution has improved significantly. UI scripting is also significantly faster.
However, especially with the latter, there are still a lot of bugs. One example:
-- Sample for ControlCenter scripting
tell theMenuBarIterm
click
end tell
set theCount to count of entire contents of window 1
--> 0
set theCount to count of entire contents of window 1
--> 14
This is not a time problem. One can wait infinitely via delay
. The first query for the count (or other objects) will always answer with „0". Without the Script Debugger I would never have thought of it!
A word about the Shortcuts app:
If this is really going to be the replacement for Automator, then good night. It feels more like a toy app.
However, you can execute AppleScript in it and also call shortcuts from AppleScript. Both with parameter passing. This is especially useful if you want to address apps that are otherwise not scriptable or want to use functions that are not available in the dictionary (e.g. calculate duration of a route, set url for reminders, etc.).
But: Even here there are still a lot of bugs. This already starts with the call of the shortcut. According to the dictionary, it should read as follows:
set theResult to run shortcut named "Test" with input theInput
After compiling it becomes:
set theResult to run shortcut named "Test" accepts input theInput
If you change anything in the script, the next compilation will fail. You have to replace accepts
with with
before.
And there are a few things to consider when passing parameters. So far I have only managed to pass the simple AppleScript types (string, bool, number, list). But even with these, within shortcuts you should cast them to the original type. For example:
on run {input, parameters}
set theImput to imput as list
end run
Edit: Records not working (Thanks @Piyomaru).
Otherwise, problems will occur e.g. when using AppleScriptObjC.
In general, when using parameters, I recommend using the “Run AppleScript” action as the input action and the parameter return worked for me with the “Stop and Output” action.
Otherwise, the Shortcuts app seems to be a useful addition when you would otherwise not get anywhere. But nothing more - at least at the moment.