Applesctipt: Saving to multiple commands to one file...
Hello, I'm fairly new to AppleScript and have been playing around with text files using several say commands for fun. I don't want random voices. I want them set to particular passages of text within one file.
I've been looking everywhere to find out how to save the file to audio and haven't found anything useful other than the 'Saving to' command, but that only works for one line of code, unless I'm doing something wrong.
I guess what I need to know is:
1) Is there a way to compound the script while keeping the code intact? Not sure if that makes sense.
2) Is there a way to write another AppleScript file to Audio? I'm thinking that would work and have found many ideas on how to open files that aren't AppleScript, but I can't seem to figure out how to work with another script within a script. I would assume it would be a simple line of code, but I can't figure out where to start.
For a basic example of a Script I'd like to convert:
Script example |
---|
say "Hello, my name is Alex." using "Alex" volume 0.5 speaking rate 240 pitch 70 say "What's wrong with your voice?" using "Lee" volume 0.5 speaking rate 90 |
I haven't played with code for over 5 years and have gotten rusty. I'm fairly sure I can call a script within a script and execute it in a variety of ways. I just don't know how to do it in AppleScript. Would variables be the way to go? if so, how would I set the Voice to use pitch, rate, volume within the variable so that I could assign it to lines of text within the script? Sorry if this is complicated. I know it can be done. I have a feeling it might be simple. I had intermediate knowledge of a few different languages coming from the Windows platform in my past life.
MacBook Air (11-INCH, MID 2011), OS X Mountain Lion