ဤထိန်းချုပ်မှုကို ပြင်ဆင်ခြင်းဖြင့် ဤစာမျက်နှာကို အလိုအလျောက် အပ်ဒိတ်လုပ်ပေးပါမည်
![](https://help.apple.com/assets/5B9190B30946221279C5A608/5B9190B30946221279C5A60F/en_US/31d7054c3bcf00abcba6dd75555bcff0.png)
Automate tasks using AppleScript and Terminal on Mac
You can use AppleScript with Terminal to save time or automate repetitive tasks. Terminal is a scriptable app that responds to AppleScript commands. These commands are described in Terminal’s AppleScript dictionary.
View Terminal’s AppleScript dictionary
In the Finder
on your Mac, open the /Applications/Utilities folder.
Drag the Terminal app icon
onto the Script Editor app icon
.
Open Terminal’s AppleScript dictionary for me
In AppleScript, you can use the Do Shell Script
command to send a UNIX shell script command to Terminal.
Run AppleScript scripts from Terminal
You can run AppleScript scripts from Terminal using the osascript command.
In the Terminal app
on your Mac, use the cd command to move into the directory that contains the script you want to run. For example:
$ cd ~/Documents/YourScriptDirectory
Enter the osascript command. For example:
$ osascript YourScript.scpt
See alsoAppleScript website