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="dhmmjoph" data-source="post: 1492876" data-attributes="member: 276211"><p>I attempted to follow these instructions, but it still didn't work.</p><p>Here is a picture of the window that appears when I right-click the App Delegate in the Interface Builder:</p><p><img src="http://i.imgur.com/lpLNJvT.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>My code in the AppDelegate looks like this:</p><p>[CODE] </p><p> property parent : class "NSObject"</p><p> property myTextField : missing value</p><p> </p><p> on test_(sender)</p><p> set theText to myTextField's stringValue()</p><p> if theText is equal to "123" then</p><p> display dialog "Yay! This works!"</p><p> end if</p><p> end test_</p><p>[/CODE]</p><p></p><p>When I run the app, type '123' in the box and hit return, nothing happens. Am I doing something else wrong?</p></blockquote><p></p>
[QUOTE="dhmmjoph, post: 1492876, member: 276211"] I attempted to follow these instructions, but it still didn't work. Here is a picture of the window that appears when I right-click the App Delegate in the Interface Builder: [IMG]http://i.imgur.com/lpLNJvT.png[/IMG] My code in the AppDelegate looks like this: [CODE] property parent : class "NSObject" property myTextField : missing value on test_(sender) set theText to myTextField's stringValue() if theText is equal to "123" then display dialog "Yay! This works!" end if end test_ [/CODE] When I run the app, type '123' in the box and hit return, nothing happens. Am I doing something else wrong? [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Set variable to output of text field- xcode 4.5, applescript
Top