• 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
AppleScript & Alex Speech Synth
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AppleScript & Alex Speech Synth


  • Subject: AppleScript & Alex Speech Synth
  • From: Ron <email@hidden>
  • Date: Mon, 26 Nov 2007 00:41:35 -0600

Hi,

I have a simple script below that converts a blob of text into a script, that then is opened in Script Editor ready to run.
The problem is, that when run it in Script Editor using the "say" command I get audio defects, text is skipped, text comes out as bleeps, etc.

I'm thinking this is a bug in AS, because having TextEdit read the same text has no issues and sounds great. Only problems
is I can't (to my knowledge) build in delays, so that I get a 4 second pause between every line.

Any thoughts?

Thanks
Ron

set current_date to current date
month of (current_date)
set currentmonth to result as number
if currentmonth < "10" then
set currentmonth to "0" & currentmonth as string
end if
day of (current_date)
set currentday to result
if currentday < "10" then
set currentday to "0" & currentday as string
end if
year of (current_date)
set currentyear to result
set currentdate to currentmonth & "-" & currentday & "-" & currentyear as string
set current_time to time of (current_date) as string
path to desktop
set path_to_desktop to result as string
set daily_readings to {path_to_desktop & "daily_readings_" & currentdate & "_" & current_time & ".txt"} as string
tell application "BBEdit"
activate
replace "\"" using "'" searching in text 1 of text window 1 options {search mode:literal, starting at top:true, wrap around:false, backwards:false, case sensitive:false, match words:false, extend selection:false}


replace "^" using "say \"" searching in text 1 of text window 1 options {search mode:grep, starting at top:true, wrap around:false, backwards:false, case sensitive:false, match words:false, extend selection:false}
replace "$" using "\"" searching in text 1 of text window 1 options {search mode:grep, starting at top:true, wrap around:false, backwards:false, case sensitive:false, match words:false, extend selection:false}
replace "^" using "delay 4\\r" searching in text 1 of text window 1 options {search mode:grep, starting at top:true, wrap around:false, backwards:false, case sensitive:false, match words:false, extend selection:false}
save text window 1 to file daily_readings
close text window 1
end tell
tell application "Script Editor"
open alias daily_readings
end tell
 _______________________________________________
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

  • Prev by Date: leopard date bug?
  • Next by Date: Re: Unable to add attachment to mail message in Leopard via Applescript
  • Previous by thread: Re: leopard date bug?
  • Next by thread: Re: Unable to add attachment to mail message in Leopard via Applescript
  • Index(es):
    • Date
    • Thread