Page 1 of 1

22 years later

Posted: Fri Oct 08, 2021 4:25 pm
by richmond62
Cripes: talk about a kick in the prawns!

Here's an 11 year old pupil of mine:
-
SShot 2021-10-08 at 19.14.29.png
SShot 2021-10-08 at 19.14.29.png (184.21 KiB) Viewed 7539 times
-
Which "threw me off" quite a bit as I ALWAYS (in my EFL programs) use a Tick image for end users to check a field's contents.
-
SShot 2021-10-08 at 19.33.06.png
SShot 2021-10-08 at 19.33.06.png (564.13 KiB) Viewed 7538 times
-

I had never used the RETURN key, and had never worked out how to.

SO . . . to the much-maligned built-in Dictionary and found on ReturnInField, which, was, frankly, like being handed the keys to
the Holy Kingdom on a plate:

Code: Select all

on returnInField
   if fld "ff" contains "black" then
      set the vis of img "YES" to true
      set the vis of img "NO" to false
   else
      set the vis of img "YES" to false
      set the vis of img "NO" to true
   end if
   if fld "ff" is empty then
      set the vis of img "YES" to false
      set the vis of img "NO" to false
   end if
end returnInField

Re: 22 years later

Posted: Mon Oct 11, 2021 7:10 pm
by xAction
Huh?

Code: Select all

On ReturnInField
set the savedText of me to line 1 to -1 of  of me
pass ReturnInField
End ReturInField

On EnterInField
put the savedText of me into myScript
do myScript
exit EnterInfield
On EnterInField
Just like the multiline part of message box. oh that doesn't work like that anymore? It's a mac thing only?
Oh duh, i turned messages off.

See my stack script for more complete functional action

Oh I'll just post it here.
ReturnInField

Code: Select all

On ReturnInField
   if the controlKey is down then
      SaveFile    
   else
      set the savedText of field 1 to line 1 to -1 of  of field 1
      
      if the label this stack is not the short name of this stack then
         put the label of this stack into tLabel
         replace "*" with empty in tLabel
         set the label of this stack to tLabel& "*"
      end if
      
   end if
   pass ReturnInField
End ReturnInField
EnterInField

Code: Select all

On EnterInField
   if the controlKey is down then
      SaveFile    
   else
      put   line 1 to -1 of  of field 1 into myScript
      set the savedText of field 1 to myScript
      do myScript
   end if
   exit EnterInfield
end EnterInField
SaveFile

Code: Select all

on SaveFile
   put  word 2  of the long name of stack the mainStack of this stack into stName
   replace quote with empty in stName
   set itemDel to "/"
   put item 1 to -2 of stName into stPath
   set the folder to stPath
   ask "Name the file"
   if it is not empty then 
      put it into tFileName
      put "file:" & stPath & "/"& it into tFile
      put line 1 to -1 of field 1  into URL tFile
      set itemDel to "."
      set the label of this stack to  item 1 of tFileName 
   end if
end SaveFile
We used your image in field thing for disclosure arrows way back in 2005. it was pure wizardry to me when we did it. Pretty sure the guy who made it for me helped roll the Tree View for RunRev eventually.