# Running other scripts with AppleScript

- Link: https://cagrimmett.com/2016/03/22/applescript-running-other-scripts/
- Published: 2016-03-22T04:00:00-04:00
- Author: Chuck Grimmett

### Today I learned:

#### Getting current folder in AppleScript

    ```language-applescript
    -- Getting path to this file tell application "Finder" to get folder of (path to me) as Unicode text set currentLocation to result set currentPOSIX to POSIX path of currentLocation
    ```

---

#### Running other AppleScript files

    ```language-applescript
    run script file "HD:path:to:file.scpt" -- How it is used with above file path run script file (currentLocation & "reformat_with_textwrangler.scpt")
    ```

---

#### Running multiple shell commands

    ```language-applescript
    do shell script "command 1; command 2;" -- How it is used with above file path to change directory and run a script do shell script "cd " & quoted form of currentPOSIX & "; python " & "count_days.py"
    ```
