Creating a script

Questions and Answers : Macintosh : Creating a script
Message board moderation

To post messages, you must log in.

AuthorMessage
Petit Soleil
Avatar

Send message
Joined: 17 Feb 03
Posts: 1497
Credit: 70,934
RAC: 0
Canada
Message 12204 - Posted: 25 Jul 2004, 4:11:05 UTC
Last modified: 25 Jul 2004, 4:11:46 UTC

When I want to run boinc I open terminal and type

cd /boinc ENTER
./boinc ENTER

What I would like to do is create a script file to launch boinc from
the finder. I know I have to create a text file and save it with .command
extension but I don't know what to write in the text file it self.

I have tried
cd /boinc ./boinc
but it's not working...it would have been too easy.
There's something missing to make it work on one line.

Another thing I would like to do eventually is to lauch boinc at startup as a service. I would
like it to run for all users (currently two) and invisible if possible. Meaning that I could see
it running only by looking at the process view.

If it's not possible I could at least put it in the "launch item" folder but it would run just on
one users.

Thanks for the help.

Best regards
Marc
ID: 12204 · Report as offensive
Profile Jeffrey
Avatar

Send message
Joined: 21 Nov 03
Posts: 4793
Credit: 26,029
RAC: 0
Message 12250 - Posted: 25 Jul 2004, 7:39:41 UTC

I could give you a crash course in shell scripting but I think this would be much easier for you.

1. Open Terminal.App
2. From the 'file' menu select 'Save As'
3. Fill in the 'save as' box with a name like 'Boinc!'
4. The 'where' box should already be at $HOME/Library/Application Support/Terminal
5. Select the 'execute this command' button
6. Enter your commands... cd boinc; ./boinc &
7. Uncheck the 'execute command in a shell' box
8. Hit save and close terminal
9. Go to the file you just created
10. Make an alias and put it anywhere you want, or simply drag the .term file into the dock
You may also want to change that ugly icon by way of the 'get info' window (cut and paste)
I suggest using the SETI icon from the seti screen saver app. We can't all have Boinc! icons yet ; )

I saw another post in here explaining how to set up a crontab, and how run it as a service.
They were both accurate if you choose to go that route.

Good Luck

ID: 12250 · Report as offensive
Petit Soleil
Avatar

Send message
Joined: 17 Feb 03
Posts: 1497
Credit: 70,934
RAC: 0
Canada
Message 12466 - Posted: 26 Jul 2004, 20:01:37 UTC - in response to Message 12250.  
Last modified: 26 Jul 2004, 20:02:04 UTC

Thanks !



> I could give you a crash course in shell scripting but I think this would be
> much easier for you.
>
ID: 12466 · Report as offensive
Profile Mad Moggies
Avatar

Send message
Joined: 27 Mar 04
Posts: 92
Credit: 14,408
RAC: 0
United Kingdom
Message 12710 - Posted: 27 Jul 2004, 12:34:10 UTC
Last modified: 27 Jul 2004, 12:36:21 UTC

I've not seen anyone else mention this way of doing it but I start SETI Boinc by having put the SETI terminal document into my Dock! Then I can start it by just clicking on that alias.

So that it starts up when I start the Mac, I've added it to the list of start-up items in my Users preferences and ticked the box to make it hidden.

This is coming from the viewpoint of someone who isn't used to using Terminal! Hope it helps someone even if not the person who started this thread.
ID: 12710 · Report as offensive

Questions and Answers : Macintosh : Creating a script


 
©2024 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.