Page 3 of 3

Re: The Dictionary . . . Again

Posted: Thu Apr 17, 2025 9:33 am
by richmond62
SShot 2025-04-17 at 12.30.45.jpg
SShot 2025-04-17 at 12.30.45.jpg (237.98 KiB) Viewed 1253 times
-
Code sample window with colourisation.

Formatting code rejigged.

Re: The Dictionary . . . Again

Posted: Thu Apr 17, 2025 12:35 pm
by richmond62
Probably the sensible thing, having displayed the code samples in a new field is to REMOVE them from the main window.

Re: The Dictionary . . . Again

Posted: Fri Apr 18, 2025 7:40 am
by richmond62
Screenshot 2025-04-18 at 10.37.52.jpg
Screenshot 2025-04-18 at 10.37.52.jpg (171.82 KiB) Viewed 1218 times
-
Code removed as proposed in previous post.

Re: The Dictionary . . . Again

Posted: Fri Apr 18, 2025 2:38 pm
by richmond62
To return to my first post in this thread; at least my Dictionary is displaying the information which the one I criticised was not:
-
Screenshot 2025-04-18 at 17.24.37.png
Screenshot 2025-04-18 at 17.24.37.png (226.39 KiB) Viewed 1206 times
-
Now WHY it is NOT displayed in the one I criticised is interesting as ALL that my one does is display the text files and add a few fancy colours and so forth.

Maybe the other Dictionary is getting its information from somewhere else, or its text import routine is wonky.

Mind you:
-
Screenshot 2025-04-18 at 17.39.43.png
Screenshot 2025-04-18 at 17.39.43.png (11.41 KiB) Viewed 1205 times
-
that return|returns is a load of old cobblers.

Re: The Dictionary . . . Again

Posted: Sun Apr 20, 2025 12:00 pm
by richmond62
Blippety-Blippety-Boo:

viewtopic.php?t=1442

This refers to a modded version of my previous stack which I shall attach here.

Re: The Dictionary . . . Again

Posted: Sun Apr 20, 2025 12:08 pm
by richmond62
The stack opens minimised like this:
-
Screenshot 2025-04-20 at 15.03.32.png
Screenshot 2025-04-20 at 15.03.32.png (24.79 KiB) Viewed 1130 times
-
And "that purple thing" contains this script:

Code: Select all

on mouseUp
   set the lockScreen to true
   set the width of this stack to 44
   set the height of this stack to 50
   put the right of stack "revMenuBar" into LEFF
   set the left of this stack to LEFF
   put the top of stack "revMenuBar" into TOPP
   set the top of this stack to TOPP
   set the vis of me to false
   set the vis of img "expand" to true
   set the label of this stack to " "
   send "mouseUp" to btn "bFORMAT"
   set the lockScreen to false
end mouseUp
So, WHY does it take 2 mouse clicks to activate?

Re: The Dictionary . . . Again

Posted: Sun Apr 20, 2025 12:11 pm
by richmond62
The (hidden) button 'bFormat' (to see this set the width of the stack to 2500 pixels) contains the following script:

Code: Select all

on mouseUp
   put empty into fld "DICK"
   --set the lockScreen to true
   put fld "sTERM" into searchO
   set the text of fld "DICK" to the searchO of btn "DataSTORE"
   ---
   put fld "DICK" into DICKON
   set the itemDelimiter to "Examples:"
   put item 1 of DICKON into PARTONE
   delete item 1 of DICKON
   set the itemDelimiter to "Description:"
   put item 2 of DICKON into PARTTWO
   delete item 2 of DICKON
   put DICKON into fld "KODE"
   _internal script colorize char 1 to (the number of chars of fld "KODE") of fld "KODE"
   put empty into fld "DICK"
   put PARTONE & cr after fld "DICK"
   put "Description:" & cr & PARTTWO after fld "DICK"
   --put 1 into DIX
   --repeat until DIX > 500
   --if word DIX of fld "DICK" contains "|" then
   --put word DIX of fld "DICK" into SQUIG
   --set the itemDelimiter to "|"
   --put item 2 of SQUIG into SQUOG
   --put SQUIG && SQUOG
   --replace word DIX of fld "DICK" with SQUOG in fld "DICK"
   --repeat for each item MAGIC in SQUOG
   --put wordoffset(MAGIC , fld "DICK") into WITCH
   --set the textColor of word WITCH of fld "DICK" to blue
   --end repeat
   --set the textStyle of word DIX of fld "DICK" to link
   --end if
   --add 1 to DIX
   --end repeat
   ---
   put the number of chars in fld "DICK" into GLYPHS
   ----
   if fld "DICK" contains "(function)" then
      replace "(function)" with (cr & numToCodePoint(1126) && "function" & cr) in fld "DICK"
      set the caseSensitive to true
      repeat for each item MAGIC in "function"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to red
      end repeat
      put 1 into CYCLE
      repeat until CYCLE > GLYPHS
         if char CYCLE of fld "DICK" = numToCodePoint(1126) then
            set the imageSource of char CYCLE of fld "DICK" to 1015
         end if
         add 1 to CYCLE
      end repeat
   end if
   ----
   if fld "DICK" contains "(property)" then
      replace "(property)" with (cr & numToCodePoint(1127) && "property" & cr) in fld "DICK"
      set the caseSensitive to true
      repeat for each item MAGIC in "property"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to red
      end repeat
      put 1 into CYCLE
      repeat until CYCLE > GLYPHS
         if char CYCLE of fld "DICK" = numToCodePoint(1127) then
            set the imageSource of char CYCLE of fld "DICK" to 1190
         end if
         add 1 to CYCLE
      end repeat
   end if
   ----
   if fld "DICK" contains "(message)" then
      replace "(message)" with (cr & numToCodePoint(1128) && "message" & cr) in fld "DICK"
      set the caseSensitive to true
      repeat for each item MAGIC in "message"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to red
      end repeat
      put 1 into CYCLE
      repeat until CYCLE > GLYPHS
         if char CYCLE of fld "DICK" = numToCodePoint(1128) then
            set the imageSource of char CYCLE of fld "DICK" to 1209
         end if
         add 1 to CYCLE
      end repeat
   end if
   ----
   if fld "DICK" contains "(glossary)" then
      replace "(glossary)" with (cr & numToCodePoint(1129) && "glossary" & cr) in fld "DICK"
      set the caseSensitive to true
      repeat for each item MAGIC in "glossary"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to red
      end repeat
      put 1 into CYCLE
      repeat until CYCLE > GLYPHS
         if char CYCLE of fld "DICK" = numToCodePoint(1129) then
            set the imageSource of char CYCLE of fld "DICK" to 1225
         end if
         add 1 to CYCLE
      end repeat
   end if
   ----
   if fld "DICK" contains "(control structure)" then
      replace "(control structure)" with (cr & numToCodePoint(1130) && "control structure" & cr) in fld "DICK"
      set the caseSensitive to true
      repeat for each item MAGIC in "control"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to red
      end repeat
      put 1 into CYCLE
      repeat until CYCLE > GLYPHS
         if char CYCLE of fld "DICK" = numToCodePoint(1130) then
            set the imageSource of char CYCLE of fld "DICK" to 1304
         end if
         add 1 to CYCLE
      end repeat
   end if
   ----
   if fld "DICK" contains "(object)" then
      replace "(object)" with (cr & numToCodePoint(1131) && "object" & cr) in fld "DICK"
      set the caseSensitive to true
      repeat for each item MAGIC in "object"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to red
      end repeat
      put 1 into CYCLE
      repeat until CYCLE > GLYPHS
         if char CYCLE of fld "DICK" = numToCodePoint(1131) then
            set the imageSource of char CYCLE of fld "DICK" to 1320
         end if
         add 1 to CYCLE
      end repeat
   end if
   ----
   if fld "DICK" contains "(command)" then
      replace "(command)" with (cr & numToCodePoint(1132) && "command" & cr) in fld "DICK"
      set the caseSensitive to true
      repeat for each item MAGIC in "command"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to red
      end repeat
      put 1 into CYCLE
      repeat until CYCLE > GLYPHS
         if char CYCLE of fld "DICK" = numToCodePoint(1132) then
            set the imageSource of char CYCLE of fld "DICK" to 1363
         end if
         add 1 to CYCLE
      end repeat
   end if
   ----
   if fld "DICK" contains "(constant)" then
      replace "(constant)" with (cr & numToCodePoint(1133) && "constant" & cr) in fld "DICK"
      set the caseSensitive to true
      repeat for each item MAGIC in "constant"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to red
      end repeat
      put 1 into CYCLE
      repeat until CYCLE > GLYPHS
         if char CYCLE of fld "DICK" = numToCodePoint(1133) then
            set the imageSource of char CYCLE of fld "DICK" to 1365
         end if
         add 1 to CYCLE
      end repeat
   end if
   ----
   if fld "DICK" contains "(keyword)" then
      replace "(keyword)" with (cr & numToCodePoint(1134) && "keyword" & cr) in fld "DICK"
      set the caseSensitive to true
      repeat for each item MAGIC in "keyword"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to red
      end repeat
      put 1 into CYCLE
      repeat until CYCLE > GLYPHS
         if char CYCLE of fld "DICK" = numToCodePoint(1134) then
            set the imageSource of char CYCLE of fld "DICK" to 1369
         end if
         add 1 to CYCLE
      end repeat
   end if
   ----
   ----
   if fld "DICK" contains "Syntax:" then
      repeat for each item MAGIC in "Syntax:"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to green
      end repeat
   end if
   ----
   if fld "DICK" contains "Synonyms:" then
      repeat for each item MAGIC in "Synonyms:"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to blue
      end repeat
   end if
   ----
   if fld "DICK" contains "----" then
      repeat for each item MAGIC in "----"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to orange
      end repeat
   end if
   ----
   if fld "DICK" contains "Params" then
      repeat for each item MAGIC in "Params"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to purple
      end repeat
   end if
   ----
   if fld "DICK" contains "Examples:" then
      repeat for each item MAGIC in "Examples"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to red
      end repeat
   end if
   ----
   if fld "DICK" contains "Description:" then
      repeat for each item MAGIC in "Description"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to blue
      end repeat
   end if
   ----
   if fld "DICK" contains "Values:" then
      repeat for each item MAGIC in "Values"
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to orange
      end repeat
   end if
   ----
   put the htmlText of field "DICK" into DICKY
   replace "----" with "<font color=" & quote & "orange" & quote & ">----</font>" in DICKY
   set the htmlText of fld "DICK" to DICKY
   ----
   put word 1 of fld "DICK" into DUMA
   if fld "DICK" contains DUMA then
      repeat for each item MAGIC in DUMA
         put wordoffset(MAGIC , fld "DICK") into WITCH
         set the textColor of word WITCH of fld "DICK" to orange
         set the textSize of word WITCH of fld "DICK" to 36
      end repeat
   end if   
   set the lockScreen to false
end mouseUp
This should ensure that a whole slew of types are badged: but this is extremely inconsistent:
-
Screenshot 2025-04-20 at 15.12.02.png
Screenshot 2025-04-20 at 15.12.02.png (92.4 KiB) Viewed 1130 times
-
For 'messageWithin' 'glossary' is both badged and coloured, while 'message' shows the holder glyph for the badge and is not coloured.

Watching activity, 'message' is both badged and coloured and then reverts. :(

Re: The Dictionary . . . Again

Posted: Sun Apr 20, 2025 6:07 pm
by richmond62
I will produce a version that does NOT assume you have a 'fekkin monster' of a display like my iMac Retina 27 inch thang offers once THAT problem mentioned above is solved (but I cannot, for the life of me, workout why it does not behave). 8-)
-
behave.jpg
behave.jpg (11.76 KiB) Viewed 1114 times
-
AND, parenthetically, if you think Austin Powers' teeth are de trĂ´p you should see my solid gold bridge going across 4 teeth. 8-)

Re: The Dictionary . . . Again

Posted: Mon Apr 21, 2025 8:29 pm
by TerryL
Making resizable would be appreciated. I couldn't work out the revert problem either.

You seem determined to colorize and badge, consider an option for neither. Maybe strip out type (like 'command', 'function') from fld "XList". Code examples in a separate field seem unnecessary. Just offering suggestions. Terry

Re: The Dictionary . . . Again

Posted: Tue Apr 22, 2025 3:46 am
by richmond62
The code examples are only in a separate field as I am unable to colourise them in the msin field.

Re: The Dictionary . . . Again

Posted: Wed Apr 23, 2025 6:24 pm
by richmond62
So:
-
Screenshot 2025-04-23 at 21.21.57.jpg
Screenshot 2025-04-23 at 21.21.57.jpg (171.63 KiB) Viewed 949 times
-
Here's a 'something' to edit the Dictionary text files, and THEN export them as date-stamped versions.

Just for the sake of illustration, here's what

Code: Select all

put the machine
spits out on my computer:
-
Screenshot 2025-04-23 at 21.25.35.png
Screenshot 2025-04-23 at 21.25.35.png (69.28 KiB) Viewed 949 times
-
So I'll add that to the list in that particular text document:
-
Screenshot 2025-04-23 at 21.29.45.jpg
Screenshot 2025-04-23 at 21.29.45.jpg (174.29 KiB) Viewed 946 times

Re: The Dictionary . . . Again

Posted: Wed Apr 23, 2025 6:34 pm
by richmond62
Exporting this gives me a document called:

machine function 4-23-25.txt

[Because MacOS at least does not like '/' in file names I have changed those for '-' signs]

To keep the North Americans happy (cough, cough) I have retained the American date format. :lol:

Code: Select all

on mouseup
   set itemDel to "/"
   set the defaultfolder to item 1 to -2 of (the effective fileName of this stack)
   put the date into XDATE
   set the itemDelimiter to "/"
   put item 1 of XDATE into X1
   put item 2 of XDATE into X2
   put item 3 of XDATE into X3
   put X1 & "-" & X2 & "-" & X3 into XXX
   put fld "DICK" into GUFF
   put GUFF into url("file:" & fld "ZZZ" && XXX & ".txt")
end mouseup
The date stamped file is saved in the folder the stack resides in.
-
Screenshot 2025-04-23 at 21.42.27.png
Screenshot 2025-04-23 at 21.42.27.png (52.76 KiB) Viewed 940 times

Re: The Dictionary . . . Again

Posted: Wed Apr 23, 2025 7:15 pm
by richmond62
Screenshot 2025-04-23 at 22.14.56.png
Screenshot 2025-04-23 at 22.14.56.png (207.85 KiB) Viewed 933 times

Re: The Dictionary . . . Again

Posted: Thu Apr 24, 2025 9:07 am
by richmond62
SShot 2025-04-24 at 12.05.00.jpg
SShot 2025-04-24 at 12.05.00.jpg (214.22 KiB) Viewed 757 times
-
Thanks to Klaus Major this may be marginally more efficient:

Code: Select all

on mouseUp
   set itemDel to "/"
   set the defaultfolder to item 1 to -2 of (the effective fileName of this stack)
   put the date into XDATE
   set the itemDelimiter to "/"
   replace "/" with "-" in XDATE
   put fld "DICK" into GUFF
   put GUFF into url("file:" & fld "ZZZ" && XDATE & ".txt")
end mouseUp