Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Set variable to output of text field- xcode 4.5, applescript
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Mark FX" data-source="post: 1492865" data-attributes="member: 211556"><p>Are you using vanilla Applescript, or ApplescriptObjC?</p><p></p><p>If your using Xcode I will assume your using the ApplescriptObjC language.</p><p></p><p>First you need to set up a property to represent the TextField at the top of your script</p><p>like this.</p><p></p><p>[CODE]</p><p>property myTextField : missing value</p><p>[/CODE]</p><p></p><p>then save the file, and then in Interface Builder this property will show up as an IBOutlet in the file object, probably the AppDelegate object if thats where your code is, then drag from this outlet to the TextField in your window, to link this textField to the property.</p><p></p><p>Then in your IBAction method you can retrieve the text from the TextField like this.</p><p></p><p>[CODE]</p><p>set theText to myTextField's stringValue() </p><p>[/CODE]</p><p></p><p>Hope this helps, I wont be able to reply to any other questions until Wednesday.</p><p></p><p>regards Mark</p></blockquote><p></p>
[QUOTE="Mark FX, post: 1492865, member: 211556"] Are you using vanilla Applescript, or ApplescriptObjC? If your using Xcode I will assume your using the ApplescriptObjC language. First you need to set up a property to represent the TextField at the top of your script like this. [CODE] property myTextField : missing value [/CODE] then save the file, and then in Interface Builder this property will show up as an IBOutlet in the file object, probably the AppDelegate object if thats where your code is, then drag from this outlet to the TextField in your window, to link this textField to the property. Then in your IBAction method you can retrieve the text from the TextField like this. [CODE] set theText to myTextField's stringValue() [/CODE] Hope this helps, I wont be able to reply to any other questions until Wednesday. regards Mark [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Set variable to output of text field- xcode 4.5, applescript
Top