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)

Posted on Oct 29, 2021 12:53 PM

Reply

Similar questions

1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Applescript cancel or close window

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.