Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jakustodus123

macrumors newbie
Original poster
Jan 11, 2009
9
0
I was looking into the speech functions of my imac and i was wondering if i could get my mac to greet me when it turns on or wakes up? or do i need some program from the internet?
 
'say' for text to speech

Use 'say'.

This is very easy to do. First, open up Terminal and type 'say hello' (without the single quotes)
You should hear a metallic voice saying hello. Typing man say will give you a list of available commands.

So, to get your computer to greet you on login, you would do the following:

1. In a text file enter something like say "hello master"
2. Name/rename the file to greet.sh
3. In a shell (Terminal), give the file executable parameters: chmod ugo+x greet.sh
4. Open System Preferences, Accounts
5. In your account settings, under Login Items, add the greet.sh script.

There are a few ways to approach this scenario, but the above is certainly the most simple and will also expose some underlying technology under the GUI that will hopefully give you a taste to learn more and play with the potential in your Mac.
 
Agreed there, the say command is brilliant. All you have to do is create a little shell script that uses the say command, set it up to run at login (there are tools for making this sort of task easier), and enjoy!
 
k so im a bit of a noob but it wont let me save as .sh the closest i could get it was .sh.rtf then the operational parameters thing i don't get at all. can you please clarify what to do? thanks for the quick reply though
 
k so im a bit of a noob but it wont let me save as .sh the closest i could get it was .sh.rtf then the operational parameters thing i don't get at all. can you please clarify what to do? thanks for the quick reply though
Are you using TextEdit? You need to make it plain text FIRST. Otherwise, the command-line interpreter won't recognize your shell script.

As for parameters: That's easy. say takes as its parameter(s) the text to speak. For example:
Code:
say greetings
OR
say it's time to code!
You get the idea.
 
i tryed that it comes up with

chmod: greet.sh: No such file or directory

what did i do wrong?
 
i tryed that it comes up with

chmod: greet.sh: No such file or directory

what did i do wrong?

You're not in the folder where greet.sh lives. use "cd <foldername>" to change directories.

EDIT: I keep forgetting about the drag to command line feature. So handy for those less CLI inclined!

B
 
i tryed that it comes up with

chmod: greet.sh: No such file or directory

what did i do wrong?

Where did you save the greet.sh file to ? Move it to your home directory then try the command again. When you open up Terminal, it defaults to the user's home directory. In Finder, thats the folder with your user name.
 
well ive done all this and when i log in it just opens the text file
did i miss something?

yes, you saved it as a text file (YOU HAD TO MAKE IT PLAIN TEXT!)
you need to make the greet file save it as greet.txt (if it doesn't give you txt, and it gives to rft then you did something wrong_ then you have to rename it greet.sh
 
ya well when i rename it to greet.sh it turns it into greet.sh.txt and still nothing happens when i log in

and i don't know if it relevant but when i do the chmod ugo+x greet.sh it just goes to another blank line in terminal, theres no comfermation of anykind
 
ya well when i rename it to greet.sh it turns it into greet.sh.txt and still nothing happens when i log in

and i don't know if it relevant but when i do the chmod ugo+x greet.sh it just goes to another blank line in terminal, theres no comfermation of anykind

right click the file. Click get info. rename the file from there.
 
Hey, thanks for the info. I am trying this to. I have definitely followed all of the steps. I have definitely made it plain text, and I have definitely changed it to greet.sh. I then log out, and when I log back in I just get the file opened into text editor.

I read the entire thing and definitely saves as .txt, then changed to .sh.

Please help.
 
alright. I just made a script waaaay easier.

just open up the script editor (I think it's in utilities) then type in
Code:
say "Welcome to Macintosh"
Quit

Then save it as greet, as an application and check the "run only" ticker.
Then make it a log in item. Now when you log in that will launch.

Hella easy!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.