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
Launching an application via script
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="Haravikk" data-source="post: 620886" data-attributes="member: 51625"><p>Hi there,</p><p></p><p>I'm a member of the popular "virtual world" Second Life which I like for building and chatting to my friends in, however, as a builder I have multiple accounts for it, and would like to create shortcuts that let me launch Second Life with appropriate command-line arguments to log me in directly.</p><p></p><p>The Second Life application itself has a simple set of command-line arguments for just such a case.</p><p></p><p>Now, I've managed to create a solution using Apple Script, but it isn't quite ideal yet. Here's the apple-script I'm using:</p><p></p><p>[code]tell application "Terminal"</p><p> do script "\"/Applications/Second Life.app/Contents/MacOS/Second Life\" -multiple -login <first-name> <second-name> <password>"</p><p>end tell[/code]</p><p></p><p>Nothing too complicated. However, the problem with this is that when it executes, it causes Terminal to open and display a window, which I don't really want. What I'm looking to do is execute the exact same instruction in a way that will invisibly execute my command, so all that happens in the end is that Second Life opens up.</p><p></p><p>I've also tried the same thing using Automator, but I end up with the automator "Run shell script" item appearing in my menu-bar which isn't ideal either (and which I can't figure out how to hide, bah!).</p><p></p><p>Is there a way to have my apple-script prevent the terminal opening in this way, or executing the script some other way? Or alternatively, is there something else I can use to do this, such as a simple program I could compile?</p><p></p><p>Thanks for any help!</p></blockquote><p></p>
[QUOTE="Haravikk, post: 620886, member: 51625"] Hi there, I'm a member of the popular "virtual world" Second Life which I like for building and chatting to my friends in, however, as a builder I have multiple accounts for it, and would like to create shortcuts that let me launch Second Life with appropriate command-line arguments to log me in directly. The Second Life application itself has a simple set of command-line arguments for just such a case. Now, I've managed to create a solution using Apple Script, but it isn't quite ideal yet. Here's the apple-script I'm using: [code]tell application "Terminal" do script "\"/Applications/Second Life.app/Contents/MacOS/Second Life\" -multiple -login <first-name> <second-name> <password>" end tell[/code] Nothing too complicated. However, the problem with this is that when it executes, it causes Terminal to open and display a window, which I don't really want. What I'm looking to do is execute the exact same instruction in a way that will invisibly execute my command, so all that happens in the end is that Second Life opens up. I've also tried the same thing using Automator, but I end up with the automator "Run shell script" item appearing in my menu-bar which isn't ideal either (and which I can't figure out how to hide, bah!). Is there a way to have my apple-script prevent the terminal opening in this way, or executing the script some other way? Or alternatively, is there something else I can use to do this, such as a simple program I could compile? Thanks for any help! [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Launching an application via script
Top