├── .gitignore ├── scripts ├── open-in-iterm │ ├── open-in-iterm.png │ ├── open-in-iterm.md │ └── open-in-iterm.json └── open-in-incognito │ ├── open-in-incognito.png │ ├── open-in-incognito.md │ └── open-in-incognito.json ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /scripts/open-in-iterm/open-in-iterm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anyboxhq/browser-deputy-scripts/HEAD/scripts/open-in-iterm/open-in-iterm.png -------------------------------------------------------------------------------- /scripts/open-in-incognito/open-in-incognito.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anyboxhq/browser-deputy-scripts/HEAD/scripts/open-in-incognito/open-in-incognito.png -------------------------------------------------------------------------------- /scripts/open-in-incognito/open-in-incognito.md: -------------------------------------------------------------------------------- 1 | # Open in Incognito 2 | 3 | Open current tab in Incognito Mode 4 | 5 | ```applescript 6 | on BrowserDeputyScript(input, link, title) 7 | tell application id "com.google.Chrome" 8 | make new window with properties {mode:"incognito"} 9 | open location link 10 | end tell 11 | end BrowserDeputyScript 12 | ``` 13 | 14 | ## Settings 15 | 16 | ![](./open-in-incognito.png) 17 | 18 | ## Download 19 | 20 | [Download open-in-incognito.json](./open-in-incognito.json) -------------------------------------------------------------------------------- /scripts/open-in-incognito/open-in-incognito.json: -------------------------------------------------------------------------------- 1 | { 2 | "script": "on BrowserDeputyScript(input, link, title)\n tell application id \"com.google.Chrome\"\n make new window with properties {mode:\"incognito\"}\n set URL of tab 1 of window 1 to link\n end tell\nend BrowserDeputyScript", 3 | "iconColor": "Text Color", 4 | "availablity": "App", 5 | "requiredAppIdentifier": "com.google.Chrome", 6 | "acceptInput": false, 7 | "keyword": "OI", 8 | "identifier": "E0BA4A66-BCEB-4A38-A47A-B6E4E6D5640B", 9 | "description": "Open current tab in Incognito Mode", 10 | "icon": "eye.slash.circle.fill", 11 | "name": "Open in Incognito" 12 | } 13 | -------------------------------------------------------------------------------- /scripts/open-in-iterm/open-in-iterm.md: -------------------------------------------------------------------------------- 1 | # Open In iTerm 2 | 3 | Open current Finder path in iTerm 4 | 5 | ```applescript 6 | on BrowserDeputyScript(input, link, title) 7 | tell application "Finder" 8 | set frontWin to URL of folder of front window 9 | set len to length of frontWin 10 | set pather to text 8 thru (len - 1) of frontWin 11 | tell application "iTerm" 12 | launch "iTerm" 13 | delay 1 14 | set newWindow to (create window with default profile) 15 | tell current session of newWindow 16 | write text "cd " & pather 17 | end tell 18 | end tell 19 | end tell 20 | end BrowserDeputyScript 21 | ``` 22 | 23 | ## Settings 24 | 25 | ![](./open-in-iterm.png) 26 | 27 | ## Download 28 | 29 | [Download open-in-iterm.json](./open-in-iterm.json) -------------------------------------------------------------------------------- /scripts/open-in-iterm/open-in-iterm.json: -------------------------------------------------------------------------------- 1 | { 2 | "script" : "on BrowserDeputyScript(input, link, title)\n\ttell application \"Finder\"\n\t\tset dir_path to quoted form of (POSIX path of (folder of the front window as alias))\n\t\ttell application \"iTerm\"\n\t\t\tlaunch \"iTerm\"\n\t\t\tdelay 1\n\t\t\tset newWindow to (create window with default profile)\n\t\t\ttell current session of newWindow\n\t\t\t\twrite text \"cd \" & dir_path\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend BrowserDeputyScript", 3 | "iconColor" : "Accent Color", 4 | "availablity" : "App", 5 | "requiredAppIdentifier" : "com.apple.finder", 6 | "acceptInput" : false, 7 | "keyword" : "IT", 8 | "identifier" : "7666A63F-3E5F-4249-A630-0D4BE02B6BE8", 9 | "description" : "Open current Finder path in iTerm", 10 | "icon" : "terminal.fill", 11 | "name" : "Open In iTerm" 12 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Anybox LTD 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Apple Script Commands for Browser Deputy 2 | 3 | A repository for users of Browser Deputy to share their Apple Script commands. 4 | 5 | ## How to Contribute 6 | 7 | ### Add New Apple Script Command in the Repository 8 | 9 | 1. Create a new folder under `scripts`. The name should be lowercased and separated by hyphen (-). 10 | 11 | 2. Create `script-name`.md. Fill in name, description, Apple Script, and a download link to the exported JSON file. 12 | 13 | 3. Add the exported JSON file under the folder. 14 | 15 | 4. Add your new script to the **Available Scripts** section of README.md. Add new app section if needed. 16 | 17 | Go to the [`scripts`](/scripts/) folder to see the real world examples. 18 | 19 | ## Available Scripts 20 | 21 | ### Google Chrome 22 | 23 | 1. [Open current tab in Incognito Mode](/scripts/open-in-incognito/open-in-incognito.md) 24 | 25 | ### Finder 26 | 27 | 1. [Open current Finder path in iTerm](/scripts/open-in-iterm/open-in-iterm.md) 28 | 29 | ## How to Add New Apple Script Command in Browser Deputy 30 | 31 | 1. Download the JSON file in the script folder. 32 | 33 | 2. Go to Browser Deputy → Settings → Scripts. 34 | 35 | 3. Click the `Import Command` button right next to the plus button. 36 | 37 | 4. Select the JSON file you’ve downloaded in the first step. 38 | 39 | Alternatively, you can just copy the Apple Script in each script folder and add it manually. 40 | 41 | ## FAQ 42 | 43 | 1. How can I export the Apple Script command as JSON file? 44 | 45 | Go to Browser Deputy → Settings → Scripts and right-click the script you want to export. You can also click the script to select, and click the export button, which is the fourth one on the toolbar. 46 | 47 | ## License 48 | 49 | MIT 50 | --------------------------------------------------------------------------------