• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: My WWDC/birthday wish
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: My WWDC/birthday wish


  • Subject: Re: My WWDC/birthday wish
  • From: Deivy Petrescu <email@hidden>
  • Date: Tue, 20 May 2014 09:05:14 -0400

On May 15, 2014, at 18:08 , Michael Grant <email@hidden> wrote:

> AppleScript was designed to be "English-like". What if Siri lived in my Mac and understood spoken AppleScript commands?
>
> Michael
>
>
> --
> There's really no such thing as translating. It's all a scam. We basically just make stuff up and try to make it sound plausible.
Michael,
you might not have Siri the way you want, but you can kind of build one for you.
But you can have your Mac understand spoken command and run some tasks.
Here is an example:
______________________________________________________________

set hora to {}
repeat with j from 0 to 23
	if j < 2 then
		set end of hora to "" & j & " hour"
	else
		set end of hora to "" & j & " hours"
	end if
end repeat

tell application "SpeechRecognitionServer"
	set ahora to listen for hora giving up after 30 with prompt "What time is it?"
	my tid("hour")
	set k to 0 + (text item 1 of ahora)
	if k > 4 and k < 12 then
		say "Good morning then..."
	else if k > 5 and k < 19 then
		say "Then, good afternoon"
	else if k > 5 and k < 23 then
		say "Good evening. I hope you had a pleasant day."
	else
		say "Nite nite!, sleep tite"
	end if
end tell



on tid(x)
	set AppleScript's text item delimiters to x
end tid

______________________________________________________________

if instead of say you had a Script set up, you can see the possibilities.

By the way, listen continuously is broken. You can file a bug report as well ( I have been doing it!)


Deivy Petrescu
email@hidden




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


References: 
 >My WWDC/birthday wish (From: Michael Grant <email@hidden>)

  • Prev by Date: Re: TextEdit oddity
  • Next by Date: Re: TextEdit oddity
  • Previous by thread: My WWDC/birthday wish
  • Next by thread: Re: My WWDC/birthday wish
  • Index(es):
    • Date
    • Thread