AppleScript text field
Hey everyone!
I have recently been doing a lot of AppleScript and Xcode 4. I have also been combining them, (making Cocoa AppleScript projects in Xcode) and today started on a project to convert text into speech. I already know how to do most of the code (like say "phrase" etc.) but I am stuck with 1 thing. I have a text box, and a button. I want to make it so that when I click the button, it will read what the user has typed in the text box and convert it into a variable which I can then make the computer speak aloud. PLEASE tell me how I can get it to convert the text in the text box into a variable... I have been trying for hours and got nowhere. I feel like I've searched every online place I can!
Here is some additional information.
My Code:
Image version...
Text version...
--
-- AppDelegate.applescript
-- TestingApplication
--
-- Created by Felix Packard on 29/04/13.
-- Copyright (c) 2013 Felix Packard. All rights reserved.
--
script AppDelegate
propertyparent : class"NSObject"
on speechButtonClicked_(sender)
end speechButtonClicked_
on helpButtonClicked_(sender)
set description to"Date created: 30-4-2013\n\nMade by: Felix Packard\n\nVersion: 1.0\n\nDescription: This applications purpose is very simple: It converts text into speech. It will be updated and have more featured over time."
display dialog description with title "Info" buttons {"Done"} default button 1
end helpButtonClicked_
on applicationWillFinishLaunching_(aNotification)
-- Insert code here to initialize your application before any files are opened
end applicationWillFinishLaunching_
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
endscript
Application Interface:
Button handler linked to 'Say Text' button (from code higher up in question):
on speechButtonClicked_(sender)
end speechButtonClicked_
Button handler linked to 'Help' button (from code higher up in question):
on helpButtonClicked_(sender)
set description to"Date created: 30-4-2013\n\nMade by: Felix Packard\n\nVersion: 1.0\n\nDescription: This applications purpose is very simple: It converts text into speech. It will be updated and have more featured over time."
display dialog description with title "Info" buttons {"Done"} default button 1
end helpButtonClicked_
All help is greatly appreciated. Thanks in advance! 🙂
iMac, Mac OS X (10.7.5)