Generally, most scripts are written in Script Editor documents. Scripts can also be written in Xcode, but this is typically for scripts that require advanced user interfaces.
For Mac geeks who want to learn more about using the command line, Wil Limoges offers this basic tip for creating and deleting files in Terminal. How to create and delete files in the Mac terminal. The copy/paste method for listing files works fine. Be sure you paste the list into a file that is plain text format, like in TextEdit, BBEdit, TextWrangler, etc. If it is not plain text it will attempt rich text pasting with the documents instead.
Launch Script Editor in /Applications/Utilities/
.
If the script isn’t configured for the correct language, choose the language in the navigation bar.
Tip
If you always use the same language, set it as the default language in the General pane of Script Editor preferences. See General Preferences.
Write your script code in the editing area. Newly written code is uncompiled and formatted as new text.
Click the Compile button () to compile the script and check for syntax errors.
If a syntax error occurs, an alert is displayed.
If the script compiles, code formatting is applied at this time.
Tip
You can change the formatting attributes, such as font and color, of uncompiled and compiled text in the Formatting pane of Script Editor preferences. See Formatting Preferences.