New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Launching an application via script


Post Reply New Thread Subscribe

 
Thread Tools
Haravikk

 
Member Since: Mar 24, 2008
Posts: 6
Haravikk is on a distinguished road

Haravikk is offline
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
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 Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
See my response here.

Searching the forum before asking is a great idea because you may answer your question quickly and get on with your task. Plus you wouldn't be using other peoples time.
QUOTE Thanks
Haravikk

 
Member Since: Mar 24, 2008
Posts: 6
Haravikk is on a distinguished road

Haravikk is offline
Quote:
Originally Posted by xstep View Post
Searching the forum before asking is a great idea because you may answer your question quickly and get on with your task. Plus you wouldn't be using other peoples time.
Thank you for the link, it solved my problem.

However, please do not be so quick to assume someone didn't search for an answer just because one does exist in the forum. I tried Google, and I tried this forum's search engine; nothing I searched for came up with anything that helped, which is why I posted this thread.

I may be new here but I'm not new to forums, I've moderated several for the better part of eight years in my spare time.

Your intention may not have been to be rude, but it's much more helpful just to say "Here's a topic that should help, I found it in a search for X, Y, and Z". This has the added benefit of letting the user know a bit more about the problem, since I, while tech savvy (a Java programmer), do not know what the best thing to search for would be. Heck, I wouldn't have expected an answer in the thread you linked to; to me the title suggests "how to just run a terminal script", it suggests nothing about hiding it etc.
Also, this way the keywords in your reply, combined with the keywords in the user's post, make it much more likely people will find relevant results more quickly in future
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
Glad to here the link solved your problem.

I'm trying to get people to be more proactive on their own. Since I didn't know what your action was before posting, the search was a good suggestion. So many people don't bother as I'm sure you are aware, based on your experience with forums. I've been accused of being too direct at times, so I'm sure I could be more tactful at times.

Your constructive domain language lesson for the day; AppleScript is one word and the S is capitalized. As a technical person you understand the value of being this exact, so don't think I'm trying to talk down to you.

Quote:
Originally Posted by Haravikk View Post
...it's much more helpful just to say "Here's a topic that should help, I found it in a search for X, Y, and Z".
So if I had said "Please see this thread titled 'Basic Terminal Automation' that can be found with the search words 'AppleScript Terminal script' within this forum.", that would have been more to your liking. I actually like that. It doesn't assume one didn't do a search, it places key words in the response, and gives a subtle hint to others how to do a search.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks

Post Reply New Thread Subscribe


« C compiler for OSX | Automator or Scripting HELP! »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Application Shutdown Script with message notification lirrincity OS X - Apps and Games 0 10-19-2007 12:34 AM
Server Error in '/' Application. deathtolife04 OS X - Apps and Games 8 08-21-2007 02:38 PM
apple script to greet me off stand by jakeroberts OS X - Development and Darwin 0 04-29-2007 12:34 PM
Application has to be transferred in a .sit Aikinai Switcher Hangout 4 10-18-2005 10:19 PM
Custom Internet Application Randomly Freezing rlecjr OS X - Development and Darwin 0 08-27-2004 09:40 AM

All times are GMT -4. The time now is 11:41 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?