% % stack: target-dir builder jsx % "// =======================================================" dup catcr replall "Orig" \_ exch write % % stack: target-dir builder % "Body" \_ "( " "(" replall " )" ")" replall "stringIDToTypeID(" "sTID(" replall "charIDToTypeID(" "cTID(" replall "executeAction" "app.executeAction" replall count ^"befvar " logs % % stack: target-dir builder adj-body % { "var id" slice isnull ? % % stack: target-dir builder left-of-var right-of-var % " = " slice ";" slice % % stack: target-dir builder left-of-var rest-of-id tid-body right-of % exch rot ^"id" % % stack: target-dir builder left-of-var right-of tid-body rest-of-id-prefxd % 3 copy &"," exch &"," replall 4 -1 roll pop tuck &")" exch &")" replall % % stack: target-dir builder left-of-var adj-right-of % trim exch trim catcr &" " ^ % % stack: target-dir builder adj-body % } loop pop count ^"aftvar " logs % % stack: target-dir builder adj-body % *jspmanle count ^"aftanld " logs % % remove incorrect var repetitions % { "var cTID(" slice isnull ? ";" Str.Right exch trim ^ } loop pop % % remove triple sets of double-quotes % '"""' '"' replall