Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Open GUI applications as root
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="gatorparrots" data-source="post: 2411"><p>If you need to edit a root-owned system configuration file, it is possible to do so with a graphical text editor, if you so desire. In fact, any application can be opened as root <em>[although why anyone would want to open Chess.app as root is beyond me...]</em> (This functionality is essentially what Brian Hill's utility Pseudo allows you to do: tp://personalpages.tds.net/~brian_hill/pseudo.html): (outdated link removed)</p><p></p><p>First, a little background about the <strong>open</strong> command:</p><p></p><p>The command is simply <strong>open</strong> (which can also be used for opening directories). The most basic example is launching an application:</p><p><span style="color: blue">open /path/to/some.app</span></p><p></p><p>More complex possibilities also exist:</p><p></p><p><span style="color: blue">open "/Volumes/Macintosh HD/somedoc.txt"</span></p><p>opens the document in the default application for its type (as determined by LaunchServices).</p><p></p><p><span style="color: blue">open /Applications/</span></p><p>opens that directory in the Finder.</p><p></p><p><span style="color: blue">open -a /Applications/TextEdit.app "/Volumes/Macintosh HD/somedoc.txt"</span></p><p>opens the document in the application specified (in this case, TextEdit).</p><p></p><p><span style="color: blue">open -e "/Volumes/Macintosh HD/somedoc.txt"</span></p><p>opens the document in TextEdit (the <strong>-e</strong> option specifies TextEdit).</p><p></p><p><span style="color: blue">open <a href="http://www.apple.com/" target="_blank">Apple</a></span></p><p>opens the URL in the default browser (lynx, naturally *wink*)</p><p></p><p><span style="color: blue">open "file://localhost/Volumes/Macintosh HD/somedoc.txt"</span></p><p>opens the document in the default application for its type (as determined by LaunchServices).</p><p></p><p><span style="color: blue">open "file://localhost/Volumes/Macintosh HD/Applications/"</span></p><p>opens that directory in the Finder.</p><p></p><p>As you can see, <strong>open</strong> is a very versatile command. However, in the following post I will point at least one glaring limitation. Let the fun begin...</p></blockquote><p></p>
[QUOTE="gatorparrots, post: 2411"] If you need to edit a root-owned system configuration file, it is possible to do so with a graphical text editor, if you so desire. In fact, any application can be opened as root [I][although why anyone would want to open Chess.app as root is beyond me...][/I] (This functionality is essentially what Brian Hill's utility Pseudo allows you to do: tp://personalpages.tds.net/~brian_hill/pseudo.html): (outdated link removed) First, a little background about the [B]open[/B] command: The command is simply [B]open[/B] (which can also be used for opening directories). The most basic example is launching an application: [COLOR=blue]open /path/to/some.app[/COLOR] More complex possibilities also exist: [COLOR=blue]open "/Volumes/Macintosh HD/somedoc.txt"[/COLOR] opens the document in the default application for its type (as determined by LaunchServices). [COLOR=blue]open /Applications/[/COLOR] opens that directory in the Finder. [COLOR=blue]open -a /Applications/TextEdit.app "/Volumes/Macintosh HD/somedoc.txt"[/COLOR] opens the document in the application specified (in this case, TextEdit). [COLOR=blue]open -e "/Volumes/Macintosh HD/somedoc.txt"[/COLOR] opens the document in TextEdit (the [B]-e[/B] option specifies TextEdit). [COLOR=blue]open [URL='http://www.apple.com/']Apple[/URL][/COLOR] opens the URL in the default browser (lynx, naturally *wink*) [COLOR=blue]open "file://localhost/Volumes/Macintosh HD/somedoc.txt"[/COLOR] opens the document in the default application for its type (as determined by LaunchServices). [COLOR=blue]open "file://localhost/Volumes/Macintosh HD/Applications/"[/COLOR] opens that directory in the Finder. As you can see, [B]open[/B] is a very versatile command. However, in the following post I will point at least one glaring limitation. Let the fun begin... [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Open GUI applications as root
Top