Applescript cancel or close window
Since Monterey, Script Editor opens with a window. I want the window to go away when Script Editor is opened.
Closing the window (although there is no close button on the window) or choosing the cancel button would work, but can't make it happen.
I put a delay in to let Script editor run and time to close window. Perhaps this is not a window in the conventional sense with no buttons on upper left corner, so scripting to click the cancel button might be better?
Thanks, as always
Window and script :
WINDOW
SCRIPT
tell application "Finder"
activate
open application file "Script Editor.app" of folder "Utilities" of folder "Applications" of folder "System" of startup disk
end tell
delay 5
tell application "Script Editor" to if it is running then close its front window
iMac Line (2012 and Later)