You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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
Question marked as Top-ranking reply

Posted on Oct 31, 2021 8:55 PM

Got it to work using Automator, with an AppleScript step, and an Automator "Watch me Do" step.

Similar questions

1 reply

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.