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