Friday, August 14, 2020

#1 2009-09-24 05:14:40 pm

From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529

Radio Buttons

OK so Craig makes it clear that with radio buttons you have to link the whole thing, not just one of the buttons.

My script:


script Dialog_MakerAppDelegate
   property parent : class "NSObject"
   property valwintext : missing value
   property valwinent : missing value
   property valwindef : missing value
   on subgo_(sender)
       set valtext to (valwintext's |string|() as string)
       if (valwinent's intValue()) is 1 then
           set valent to " default answer \""
           set valent to ""
       end if
       tell application "TextEdit"
           tell application "System Events"
               keystroke "display dialog \"" & valtext & "\"" & valent --& valentdef & valentsec & valbut & valbutdef & valbutcal & valtit & valicon & valtmout
           end tell
       end tell
   end subgo_
   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 true
   end applicationShouldTerminate_
end script

So if valwinent is linked to the whole radio group using intValue it always returns 1 (and actions) if using stringValue it always returns 0 (there are many more combos with 'as string' and things) but if I link valwinent to either one of the radio button on their own it works fine. I get this hunch I might be using the wrong method, oh well I'd like an answer but no rush, I can use my way for now. smile


What the! Now my way isn't working whats going on?


Got my way working again with intValue.

Last edited by Richard (2009-09-24 05:44:29 pm)

Filed under: System, TextEdit



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)