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
Apple Event: May 7th at 7 am PT
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
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.
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'.
It can be simpler than that. This is all you need in Applescript:
say "Hello master, what can I do for you today" using "Alex"
(without 'using "Alex"' or other voice you get the default)
Save as an application somewhere convenient and select in System Preferences>Accounts>Login items
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?