Crashing error with code folding

I’m having a crashing error that seems related code folding.

I have a fairly simple script with a good sized implicit run handler and two handlers.

When i click the code folding for one handler SD ends up in an unstable state and has to be quit and relaunched. In one case it gave me the crash or continue dialog, but wouldn’t let me click crash (couldn’t see the cursor) but responded to the enter key which triggered the Continue option.

Crash reporter did not appear when relaunched

–> Script Debugger 7.0.9 (7A81)
–> Mac OS 10.11.6

This is the script that is giving me grief. It’s a fairly simple script with only a 1 handler. It uses MyriadTables. (It’s works best if it’s run from AppleMenu scripts.

Is it possible that not having a blank line between the foldable code and the previous code is what’s tripping up the folding? I usually do but didn’t this time. I’ll play with that and see if I can reproduce on a different script

use scripting additions
use script "Myriad Tables Lib" version "1.0.7"
set orderingInfo to {"What's on TV Thursday", "whats-on-tv-thursday-20190606", "la-et-st-0606-whats-on-tv-thursday-20190606", "What's on TV for Thu., June 6, 2019", "Thu., June 6, 2019", "June 05, 2019, 8:00 PM", "June 05, 2019", ""}
set {headlineString, stringForSlug, internalSlug, stringForDeck, ¬
	pubDateString, onlineDate, planningPubDate, extraInfoForDay} to orderingInfo
set NGTeam to "Matt Cooper,Hal Wells,Taylor Arthur"
set byLineString to "Ed Stockly"
set sectionString to "Entertainment and Arts"
set orderingTable to {¬
	{"Headline", headlineString}, ¬
	{"Slug", stringForSlug}, ¬
	{"Internal Slug", internalSlug}, ¬
	{"Deck", stringForDeck}, ¬
	{"Byline", byLineString}, ¬
	{"Primary Section", sectionString}, ¬
	{"PubDate", pubDateString}, ¬
	{"Online Date", onlineDate}, ¬
	{"Planning Info", planningPubDate}, ¬
	{"Extra Info", extraInfoForDay}, ¬
	{"Team Members", NGTeam} ¬
		}
set initialPosition to {25.0, 25}
set tableTitle to "Graphene Ordering"
set tablePrompt to "Select Item to Copy & Paste"
set OKButton to "Copy & Paste & Next"
set CancelButton to "Cancel"
set extraButton to "Back"
set totalCount to count of orderingTable
set x to 1
repeat
	
	set tableData to make new table with data orderingTable ¬
		with title tableTitle ¬
		with prompt tablePrompt ¬
		multiple selections allowed false ¬
		can add and delete false ¬
		editable columns {} ¬
		column headings {"Label", "Value"} ¬
		row numbering false ¬
		initially selected rows {x} ¬
		empty selection allowed false ¬
		row template {"", ""} ¬
		multiple lines allowed false ¬
		with double click means OK
	
	
	
	modify table tableData ¬
		OK button name OKButton ¬
		OK button is default true ¬
		cancel button name CancelButton ¬
		extra button name extraButton ¬
		alternate backgrounds true ¬
		row dragging false ¬
		column reordering false ¬
		initial position initialPosition
	
	set resultValue to display table tableData ¬
		with extended results
	set selectedText to item 2 of item 1 of values selected of resultValue
	set whichButton to button number of resultValue
	set initialPosition to final position of resultValue
	if whichButton is 2 then
		set x to x - 1
		if x = 0 then set x to 1
	else
		set x to x + 1
		my EnterString(selectedText)
		beep
	end if
	
end repeat
on EnterString(selectedText)
	set the clipboard to selectedText
	tell application "Google Chrome"
		activate
	end tell
end EnterString

FWIW, I can’t reproduce any problem with your script here.

No problem on my laptop. I’ll upgrade to 7.0.9 and try again.

–> Script Debugger 7.0.8 (7A80)
–> Mac OS 10.13.6 (17G7024)

Seemed to work fine at first, then crashed when I ran it a few times and turned debugging on. (Crash reporter appeared on relaunch)

Plus, when the Table display cleared refreshed, the buttons and rows didn’t look highlighted and the SD controls didn’t work. I had to switch active apps.

–> Script Debugger 7.0.9 (7A81)
–> Mac OS 10.13.6 (17G7024)

100% reproducible on my laptop.

Launch SD with the above script. Put it in debugging mode.

Try to fold the handler at the bottom —Boom.

That’s an OS thing. I see it semi-regularly in various apps — it can be infuriating, but I can’t see any obvious explanation.

I’m still not seeing it. Can you email me the actual file?

Will do, but, on my laptop I simply copied and pasted the script above in a new script window.

FYI, just tried the exact same thing on my macMini.

Copied the above script. Launched SD. New window. Pasted in the script. Compiled. Switched to debugging mode. Clicked the Folding triangle on the handler at the bottom of the script. Didn’t fold. SD becomes unusable. Didn’t crash, but can’t do select anything in the script. Some menu items work, but if I try to make a new script the display get’s all wonky. Have to force quit.

I don’t know if this is related by I’m having a lot of issues with this version of SD. For example, trying to open numerous documents at once fries the UI (elements get jammed together, lots of artifacts, dialogs are blank, have to quit)

Seems very unstable. So much that I’m ready to revert to the previous version.

Anyone else?

Reverted and the issue went away. Also, trying to reinstall was a pain.

Basically when I install a new version of SD I open the file, and drag the SD icon into the Applications folder and click Replace. Tried to do this three times and each time it failed (a message saying it couldn’t do that because something was missing).

I know the 7.08 version was fine, something got munged in the 7.09 version. The Icon was a greyed out generic icon. On the third time I dragged SD to the trash and relaunched the finder and it worked. But the SD icon on the doc is a greyed out generic icon with circle-with-a-slash symbol on it.

I think there’s something bad going on with 7.0.9. I’ve had issues on all three systems I’ve installed it on.

Anyone else have issues?

–> Script Debugger 7.0.8 (7A74)
–> Mac OS 10.11.6 (15G22010)

I tried again with your file, but it’s still working fine. At least one of the Macs you’re running it on is running something newer than 10.11, correct?

Yes. My laptop. It worked fine on 7.0.8 but crashed when I upgraded.

–> Mac OS 10.13.6 (17G7024)