This article is intended to document some common methods or operations in AppleScript. This article is intended for developers who have some knowledge of AppleScript.

First, put the process in the first window

Tell application "System Events" set frontmost of process "to true keystroke "1" using command down delay 0.2 end tellCopy the code

Keyboard input “1” can be replaced at will to replace the number of keyboard keys, the corresponding number of the keyboard please see this page.

2. Iterate over all folder names in a folder

Make sure your folder path is the format example in this example: XXX: User: UserName: Desktop: "XXX" tell application System "Events" set path_list to POSIX path of every disk item of "path" end tellCopy the code

Later encountered more commonly used update