|
| 1 | +--- |
| 2 | +title: Studio command-line interface |
| 3 | +description: Roblox Studio supports command-line arguments that let you start Studio in a variety of ways and access special Studio functionality. |
| 4 | +--- |
| 5 | + |
| 6 | +Roblox Studio supports command-line arguments that let you launch it with special functionality, such as opening a specific place or script when Studio starts. The Roblox Studio executable is typically installed in the following locations: |
| 7 | + |
| 8 | +<table> |
| 9 | + <thead> |
| 10 | + <tr> |
| 11 | + <th>OS</th> |
| 12 | + <th>Location</th> |
| 13 | + </tr> |
| 14 | + </thead> |
| 15 | + <tbody> |
| 16 | + <tr> |
| 17 | + <td>Windows</td> |
| 18 | + <td>`C:\Users\[YourUsername]\AppData\Local\Roblox.exe`</td> |
| 19 | + </tr> |
| 20 | + <tr> |
| 21 | + <td>Mac</td> |
| 22 | + <td>`/Applications/RobloxStudio.app/Contents/MacOS/RobloxStudio`</td> |
| 23 | + </tr> |
| 24 | + </tbody> |
| 25 | +</table> |
| 26 | + |
| 27 | +## Open a place |
| 28 | + |
| 29 | +To open a place, specify the place ID, universe ID, and a task. These arguments are required. |
| 30 | + |
| 31 | +### Required arguments |
| 32 | + |
| 33 | +<table> |
| 34 | + <thead> |
| 35 | + <tr> |
| 36 | + <th>Argument</th> |
| 37 | + <th>Description</th> |
| 38 | + </tr> |
| 39 | + </thead> |
| 40 | + <tbody> |
| 41 | + <tr> |
| 42 | + <td><code>-placeId <placeId></code></td> |
| 43 | + <td>The numeric ID of the place to open.</td> |
| 44 | + </tr> |
| 45 | + <tr> |
| 46 | + <td><code>-universeId <universeId></code></td> |
| 47 | + <td>The universe that owns the place.</td> |
| 48 | + </tr> |
| 49 | + <tr> |
| 50 | + <td><code>-task <taskName></code></td> |
| 51 | + <td>Specifies how Studio opens the place based on the given task. See the <a href="#supported-tasks">Supported tasks</a> table for more information.</td> |
| 52 | + </tr> |
| 53 | + </tbody> |
| 54 | +</table> |
| 55 | + |
| 56 | +### Supported tasks |
| 57 | + |
| 58 | +<table> |
| 59 | + <thead> |
| 60 | + <tr> |
| 61 | + <th>Argument</th> |
| 62 | + <th>Description</th> |
| 63 | + </tr> |
| 64 | + </thead> |
| 65 | + <tbody> |
| 66 | + <tr> |
| 67 | + <td><code>EditPlace</code></td> |
| 68 | + <td>Opens the latest version of the place.</td> |
| 69 | + </tr> |
| 70 | + <tr> |
| 71 | + <td><code>EditPlaceRevision</code></td> |
| 72 | + <td>Opens a specific previous version of the place. This task requires you specify the place version with <code>-placeVersion <versionNumber></code>.</td> |
| 73 | + </tr> |
| 74 | + </tbody> |
| 75 | +</table> |
| 76 | + |
| 77 | +### Examples |
| 78 | + |
| 79 | +```shell |
| 80 | +Roblox.exe -placeId 101570895440344 -universeId 9808504031 -task EditPlace |
| 81 | + |
| 82 | +Roblox.exe -placeId 101570895440344 -universeId 9808504031 -task EditPlaceRevision -placeVersion 2 |
| 83 | +``` |
| 84 | + |
| 85 | +## Open a script |
| 86 | + |
| 87 | +To open a script, specify the place ID, universe ID, and task as described in the [Open a place](#open-a-place) section. Then provide one of the following arguments depending on how you want to open the script. |
| 88 | + |
| 89 | +<table> |
| 90 | + <thead> |
| 91 | + <tr> |
| 92 | + <th>Argument</th> |
| 93 | + <th>Description</th> |
| 94 | + </tr> |
| 95 | + </thead> |
| 96 | + <tbody> |
| 97 | + <tr> |
| 98 | + <td><code>-openScriptPath <path></code></td> |
| 99 | + <td><p>The path to the script. Must use `/` as separators and follow absolute `Global.LuaGlobals.require()|require-by-string` semantics. For example: </p> |
| 100 | + ```-openScriptPath Workspace/MyFolder/MyScript```</td> |
| 101 | + </tr> |
| 102 | + <tr> |
| 103 | + <td><code>-openScriptFromId <uniquedId></code></td> |
| 104 | + <td><p>The ID of the script to open. For example:</p> |
| 105 | + ```-openScriptFromId 604a6aa2-04cc-c820-09b3-a1dc0000537f```</td> |
| 106 | + </tr> |
| 107 | + </tbody> |
| 108 | +</table> |
| 109 | + |
| 110 | +### Optional highlighting |
| 111 | + |
| 112 | +Optionally, you can highlight specific lines or a character range when opening the script with the following arguments. |
| 113 | + |
| 114 | +<table> |
| 115 | + <thead> |
| 116 | + <tr> |
| 117 | + <th>Arguments</th> |
| 118 | + <th>Description</th> |
| 119 | + </tr> |
| 120 | + </thead> |
| 121 | + <tbody> |
| 122 | + <tr> |
| 123 | + <td> |
| 124 | + `-startLine <line>`<br/> |
| 125 | + `-endLine <line>` |
| 126 | + </td> |
| 127 | + <td>Highlight entire lines</td> |
| 128 | + </tr> |
| 129 | + <tr> |
| 130 | + <td> |
| 131 | + `-startLine <line>`<br/> |
| 132 | + `-endLine <line>`<br/> |
| 133 | + `-startCharacter <char>`<br/> |
| 134 | + `-endCharacter <char>` |
| 135 | + </td> |
| 136 | + <td>Highlight a character range</td> |
| 137 | + </tr> |
| 138 | + </tbody> |
| 139 | +</table> |
| 140 | + |
| 141 | +The following indexing rules apply to each argument: |
| 142 | + |
| 143 | +- Line numbers and character positions are 1-based. |
| 144 | +- The start position is inclusive, and the end position is exclusive. |
| 145 | +- Negative values are not supported. |
| 146 | + |
| 147 | +For example, given the following string: |
| 148 | + |
| 149 | +```shell |
| 150 | +print("Hello World") |
| 151 | +``` |
| 152 | + |
| 153 | +You can highlight `print` using the following arguments and values: |
| 154 | + |
| 155 | +```shell |
| 156 | +-startLine 1 -endLine 1 -startCharacter 1 -endCharacter 6 |
| 157 | +``` |
0 commit comments