text to speech

hi im paul davison and i have a bit of a dilema.
i am a university student studying creative music technology and i have to do a performance . have have a concept but i have no idea how i will pull it off!
the thing is i have been told to use applescript to help me in my quest but my performance is 5 weeks away.
my concept is that i want an audience to participate using sms with mobile phone.
so i have downloaded bluephone elite 2 which is great .i want my imac to read the messages to me with text to speech and a pause of 10 secs and to display the text on a projector
i am also using isadora which i know wont accept apple script but will run from midi messages.
how can i achieve this any help would be greatful as i know i cant learn applescript in like 3 weeks before i start running through the performance.
i have access to isadora
logic 8
reason 4
ikon

ps would it be easier doing this with automator?
hope somebody can help
paul

Hi Paul,

BluePhoneElite has a quite good AppleScript support.
On the installer dmg file there is a folder containing sample scripts.
The included help or the FAQ on BPE’s web site describes how to connect the event handler(s)

This is the show-sms script slightly modified to speak the contents of each message.
The delay 10 line (which is commented out now) stops the script for 10 secs.
But I have no idea how the projector is working.
There could also be a timing problem, when a message comes in while the script waits.
Maybe you must use a second script to pass the messages to a queue like a printer spooler

using terms from application "BluePhoneElite 2"
	-- set up a handler for this event
	on incoming message theMessage with event "text"
		-- lets us refer to properties of the message without having to say 'of theMessage' each time
		tell theMessage
			-- get the name or phone number of the sender of the message
			set theSender to the display value of the sender
			if theSender is missing value then set theSender to "Unknown Sender"
			-- get the content of the message
			set theContent to the content
			-- combine the strings and display a dialog with the results
			say theContent
			-- delay 10
			-- the code to display the text goes here
		end tell
	end incoming message
end using terms from

wow thanks for the reply
i will try this tomorrow . like i say i am new to applescripts and automator ,so i will try this script and will get back to you as soon as possible . its nice that there are people here to help!
once again thanks will keep in touch!
paul davison:D

yes this apple script works or at least the text to speech works ,dont know if the delay works as yet!
is there such a script that will save all text messages onto a text edit file as they come in to my bluephone elite like copy and paste on to 1 file automatically without me renaming a file etc.
so as a text comes in text to speech works then the message gets automatically saved to a text file and all the other text files will be copied to the same text file .
that would be really cool if this does work
im really appreciated
paul davison :stuck_out_tongue:

this version writes the contents of all incoming messages into a file “myMessages” on the desktop
always appending the new text


using terms from application "BluePhoneElite 2"
	-- set up a handler for this event
	on incoming message theMessage with event "text"
		-- lets us refer to properties of the message without having to say 'of theMessage' each time
		tell theMessage
			-- get the name or phone number of the sender of the message
			set theSender to the display value of the sender
			if theSender is missing value then set theSender to "Unknown Sender"
			-- get the content of the message
			set theContent to the content
			-- combine the strings and display a dialog with the results
			say theContent
			write_to_disk of me from theContent
			-- delay 10
			-- the code to display the text goes here
		end tell
	end incoming message
end using terms from

on write_to_disk from theData
	set theFile to ((path to desktop as text) & "myMessages.txt")
	try
		set ff to open for access file theFile with write permission
		write theData & return & return to ff starting at eof
		close access ff
		return true
	on error
		try
			close access file theFile
		end try
		return false
	end try
end write_to_disk

wow great work stefank.
this is working great upto press
i am now nearly there .
the programme that i want my txt to go into is isadora its a great application for live visuals etc.
so i tried to write my own applescript by myself and i come up with this


tell application “Isadora”
tell document 1
broadcast to value “hello every1” on channel 1
end tell
end tell
now this script lets me send the line “hello every1” to isadora which is great .
how would i let applescript send all the text of each document saved by bluephone elite with a 10 second delay time into isadora
hope you can help i am nearly there to completing this dilema.
i hope you understand what i am trying to do stefan , and i appreciate your time immense.
jope to hear from you soon
paul

Hello StefanK

your script is working great.

I want to read the content of the Textfile “myMessanges.txt” and and if there is an incomming same messages in the Textfile to exit the script ( else it automatic returns SMS with an text-answer).

thanks
Zyrus from Vienna
iMac, OS x 6.8