#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" Untitled 3 Pfunction countUnicodeLines @tdata put number of characters of tdata into tlength set useunicode to true put 1 into tlinecount repeat with i = 1 to tlength step 2 if chartonum(char i to i+1 of tdata) is 10 then add 1 to tlinecount end repeat return tlinecount end countUnicodeLines function UnicodeLineOffset @tdata,whichline put number of characters of tdata into tlength set useunicode to true put 1 into tlinecount put 1 into tlineoffset repeat with i = 1 to tlength step 2 if tlinecount is whichline then exit repeat if chartonum(char i to i+1 of tdata) is 10 then add 1 to tlinecount put i+2 into tlineoffset end if end repeat if whichline > tlinecount then put tlength + 1 into tlineoffset return tlineoffset end UnicodeLineOffset function unicodeLineNum pFldname put the unicodetext of fld pFldname into tUnicodeText return countUnicodeLines(tUnicodeText) end unicodeLineNum function unicodeThisLine pFldname, pStart put the unicodetext of fld pFldname into tUnicodeText put UnicodeLineOffset(tUnicodeText,pStart) into startchar put UnicodeLineOffset(tUnicodeText,pStart+1) - 1 into endchar return (char startchar to endchar of tUnicodeText) end unicodeThisLine function unicodeLineToLine pFldname, pStart, pEnd put the unicodetext of fld pFldname into tdata put UnicodeLineOffset(tdata,pStart) into startchar put UnicodeLineOffset(tdata,pEnd+1) - 1 into endchar return (char startchar to endchar of tdata) end unicodeLineToLine h d {e[u U Lucida Grande,Japanese U Lucida Grande U Osaka,Japanese U ,Japanese U ,Japanese U Lucida Grande U Osaka,Japanese U Lucida Grande,Japanese U Osaka,utf8 cREVGeneral scriptChecksum #yF0{4y bookmarks handlerList TcountUnicodeLines UnicodeLineOffset unicodeLineNum unicodeThisLine unicodeLineToLinetempScript prevHandler scriptSelection char 255 to 254stackfileversion script )
function countUnicodeLines @tdata
put number of characters of tdata into tlength
set useunicode to true
put 1 into tlinecount
repeat with i = 1 to tlength step 2
if chartonum(char i to i+1 of tdata) is 10 then add 1 to tlinecount
end repeat
return tlinecount
end countUnicodeLines
function UnicodeLineOffset @tdata,whichline
put number of characters of tdata into tlength
set useunicode to true
put 1 into tlinecount
put 1 into tlineoffset
repeat with i = 1 to tlength step 2
if tlinecount is whichline then exit repeat
if chartonum(char i to i+1 of tdata) is 10 then
add 1 to tlinecount
put i+2 into tlineoffset
end if
end repeat
if whichline > tlinecount then put tlength + 1 into tlineoffset
return tlineoffset
end UnicodeLineOffset
function unicodeLineNum pFldname
put the unicodetext of fld pFldname into tUnicodeText
return countUnicodeLines(tUnicodeText)
end unicodeLineNum
function unicodeThisLine pFldname, pStart
put the unicodetext of fld pFldname into tUnicodeText
put UnicodeLineOffset(tUnicodeText,pStart) into startchar
put UnicodeLineOffset(tUnicodeText,pStart+1) - 1 into endchar
return (char startchar to endchar of tUnicodeText)
end unicodeThisLine
function unicodeLineToLine pFldname, pStart, pEnd
put the unicodetext of fld pFldname into tdata
put UnicodeLineOffset(tdata,pStart) into startchar
put UnicodeLineOffset(tdata,pEnd+1) - 1 into endchar
return (char startchar to endchar of tdata)
end unicodeLineToLine
@ jpTable )k $ D L < cREVGeneral revUniqueID 1143933680947 ` W J tInput )h x. 6 cREVGeneral revUniqueID 1143933769316 0B0D0F,0K0M0O,0U0W0Y,0_0a0dN 0D,0,,0o0kR ,0{0x0h 0K0M0O,0U0W0Y,0_0a Button ex on mouseUp get the unicodeText of fld "tInput" replace uniencode(comma) with uniencode(tab) in it set the textfont of fld "jpTable" to "Osaka,utf8" set the unicodeText of fld "jpTable" to it end mouseUp $ 00000keg,0000 cREVGeneral scriptChecksum $ :ih4revUniqueID 1143933802868 bookmarks handlerList mouseUptempScript prevHandler mouseUpscriptSelection char 212 to 211script %on mouseUp
get the unicodeText of fld "tInput"
replace uniencode(comma) with uniencode(tab) in it
set the textfont of fld "jpTable" to "Osaka,utf8"
set the unicodeText of fld "jpTable" to it
end mouseUp
tReplace )h cREVGeneral revUniqueID 1143933822065 eg, tCell )h cREVGeneral revUniqueID 1143933843213 1,2 Button ex on mouseUp replaceCell jpTable, tReplace, tCell end mouseUp on replaceCell pTableField, pReplaceText, pCell repeat with i=1 to unicodeLineNum(pTableField) put urlEncode(unidecode(unicodeThisLine(pTableField,i), utf8)) &cr after tUrlTable end repeat replace urlEncode(tab) with comma in tUrlTable put item 1 of fld pCell into tColumn put item 2 of fld pCell into tRow put the num of items of line tRow of tUrlTable into tLastItem if tColumn = tLastItem then put urlEncode(unidecode(fld pReplaceText, utf8))&urlEncode(cr) into item tColumn of line tRow of tUrlTable else put urlEncode(unidecode(fld pReplaceText, utf8)) into item tColumn of line tRow of tUrlTable end if replace comma with urlEncode(tab) in tUrlTable repeat with i=1 to unicodeLineNum(pTableField) put urlDecode(line i of tUrlTable) after tNewTable end repeat set the unicodeText of fld "jpTable" to uniEncode(tNewTable,utf8) end replaceCell &D 000]0Wf0H cREVGeneral scriptChecksum uїSUΨrevUniqueID 1143933855567 bookmarks handlerList mouseUp replaceCelltempScript prevHandler mouseUpscriptSelection char 954 to 953script son mouseUp
replaceCell jpTable, tReplace, tCell
end mouseUp
on replaceCell pTableField, pReplaceText, pCell
repeat with i=1 to unicodeLineNum(pTableField)
put urlEncode(unidecode(unicodeThisLine(pTableField,i), utf8)) &cr after tUrlTable
end repeat
replace urlEncode(tab) with comma in tUrlTable
put item 1 of fld pCell into tColumn
put item 2 of fld pCell into tRow
put the num of items of line tRow of tUrlTable into tLastItem
if tColumn = tLastItem then
put urlEncode(unidecode(fld pReplaceText, utf8))&urlEncode(cr) into item tColumn of line tRow of tUrlTable
else
put urlEncode(unidecode(fld pReplaceText, utf8)) into item tColumn of line tRow of tUrlTable
end if
replace comma with urlEncode(tab) in tUrlTable
repeat with i=1 to unicodeLineNum(pTableField)
put urlDecode(line i of tUrlTable) after tNewTable
end repeat
set the unicodeText of fld "jpTable" to uniEncode(tNewTable,utf8)
end replaceCell
Label Field 3 d cREVTable currentview [差し替え文:
cREVGeneral revUniqueID 1143939093512 ]0Wf0He Label Field v cREVTable currentview {セル(コラム、ロウ)
cREVGeneral revUniqueID 1143939135407 00000000 Line K J b cREVGeneral revUniqueID 1143939469589 Label Field h cREVTable currentview by Kenji Kojima : cREVGeneral revUniqueID 1143939481010 by Kenji Kojima : Label Field d cREVTable currentview Set Table cREVGeneral revUniqueID 1158616400459 Set Table Label Field D d cREVTable currentview Change Cell cREVGeneral revUniqueID 1158616427784 Change Cell