Can I save Text to Speech to an Audio Fil…
apple Verified ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
I know I can right-click some text, and have it save the spoken track to iTunes. Is it possible to get the spoken track to be saved to a user-specified location rather than iTunes?
8 replies
Sign in or join Beachball Help to reply.
- 0
red_menace ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
An
AppleScript can say something to a file (see *Standard Additions* for other options), so you could use a *Run AppleScript* action in
Automator to add a Service, for example:
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #B5FF6C;
overflow: auto;"
title="this text can be pasted into the AppleScript Editor">
on run {input, parameters}say (input as text) saving to (choose file name default name "Speech.aiff")
-- return input
end run
</pre> - 0
red_menace ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
There are a few different ways to format script/code snippets. Placing your code between two
{code} statements will (mostly) keep the forum from mangling the formatting, and you can also use HTML. I use an AppleScript that formats a script copied to the clipboard with HTML, it is available
here. There is also a code formatting script in the *User Tips Library*
here.There are quite a few AppleScript resources out there, such as:
http://macscripter.net/
http://www.macosxautomation.com/
http://www.scriptweb.com/...and Apple's Developer documentation, of course:
Introduction to AppleScript Overview
AppleScript Fundamentals
Introduction to AppleScript Language Guide - 0
red_menace ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
An
AppleScript can say something to a file (see *Standard Additions* for other options), so you could use a *Run AppleScript* action in
Automator to add a Service, for example:
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #B5FF6C;
overflow: auto;"
title="this text can be pasted into the AppleScript Editor">
on run {input, parameters}say (input as text) saving to (choose file name default name "Speech.aiff")
-- return input
end run
</pre> - 0
musicwind95 ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
I know almost nothing about AppleScript, so I probably wouldn't know how to use that...What I'm looking for is a service or a extension to the right-click menu in Snow Leopard when I select some text so tt, similar to "Add to iTunes as a spoken track", I'd like it to prompt for a folder, and then convert the text to audio and output the result to the selected folder. Does that make sense?
- 0
red_menace ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
It is fairly easy to make a Service using Automator. When launching Automator, it will ask for a template to use - select
Service. The default template will receive selected text from any application, so the only thing needed is to drag the *Run AppleScript* action (located in the Utilities category) into the workflow document and edit the script.The AppleScript I posted previously (paste it into the *Run AppleScript* action) will put up a standard file dialog to select a name and location for the sound file that will be created from the selected text. After saving the workflow, it will be available in the Services menu.
- 0
musicwind95 ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Thanks! That's exactly what I wanted.
However, I'm curious to know how you made that green box in your previous post? In addition, are there any good resources to learn AppleScript out there?
- 0
red_menace ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
There are a few different ways to format script/code snippets. Placing your code between two
{code} statements will (mostly) keep the forum from mangling the formatting, and you can also use HTML. I use an AppleScript that formats a script copied to the clipboard with HTML, it is available
here. There is also a code formatting script in the *User Tips Library*
here.There are quite a few AppleScript resources out there, such as:
http://macscripter.net/
http://www.macosxautomation.com/
http://www.scriptweb.com/...and Apple's Developer documentation, of course:
Introduction to AppleScript Overview
AppleScript Fundamentals
Introduction to AppleScript Language Guide - 0