Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Making Terminal Command?

When I set login to my computer I would like the mac voice to say "Hello master, what can I do for you today?" via terminal. How would I go about making a file to do this?

MacBook, iOS 6.1.4

Posted on Jun 16, 2013 3:04 PM

Reply
5 replies

Jun 16, 2013 4:44 PM in response to iScreamMonster

iScreamMonster wrote:


When I set login to my computer I would like the mac voice to say "Hello master, what can I do for you today?" via terminal. How would I go about making a file to do this?

That doesn't sound like a Terminal thing. You can have Terminal speak with the "say" command but to execute something on login would need to be something you can put into System Preferences > Users & Groups > <your account> > Login Items


Use AppleScript Editor to create a script that contains the following:

tell application "System Events"

say "Hello master, what can I do for you today?"

end tell


Save it as an application somewhere and put it into your Login Items.

Jun 16, 2013 5:33 PM in response to iScreamMonster

Similar to 'etresoft', but slightly different, I would create an Automator app (Applicaiton -> Automator -> Application), select the action "Run Shell Script". Replace 'cat' in the default 'Run Shell Script' with


say "Hello master, what can I do for you today?"


Save this as an application.


Now System Preferences -> Accounts -> Login Items, and either drag and drop your Run Shell Script Automator app to the Login Items window, or click on the [+] symbol and navigate to your Run Shell Script Automator app and select it as a Login Item.


You can customize the 'say' command via options to specify a different voice. See "man say" in the terminal.


NOTE: etresoft's Applescript example allows even more 'say' customization than what is available in the 'say' command run from the terminal, but you will need to Google for Applescript examples using 'say'.

Jun 17, 2013 1:36 AM in response to Roger Wilmut1

You might also like to try this script:



set d to (current date) as string


set e to time of (current date)

set f to "46800"

set g to "61200"

if e comes before f then

say "Good morning"

else

if e comes after g then

say "Good evening"

else

say "Good afternoon"

end if

end if

set h to 1st word of d

set i to 2nd word of d

set j to 3rd word of d

if j = 1 then

set l to "st"

else if j = 2 then

set l to "nd"

else if j = 3 then

set l to "rd"

else if j = 21 then

set l to "st"

else if j = 22 then

set l to "nd"

else if j = "23" then

set l to "rd"

else if j = "31" then

set l to "st"

else

set l to "th"

end if

set k to "It's " & h & " " & i & " " & j & l


sayk


Making Terminal Command?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.