REVO2700 textReaderMain 3 local lKeyData, lLineCounter on suspendstack global gRevAppIcon,gRevSmallAppIcon put "203318" into gRevAppIcon put "203318" into gRevSmallAppIcon pass suspendstack end suspendstack on resumestack setIcons end resumestack on sortBy keyField -- parallel sorting of linked flds put fld keyField into lKeyData put "ref,charList,descr,tChunk" into dataFields -- fill in your fld names here repeat with i = 1 to the number of items of dataFields put 0 into lLineCounter sort lines of fld (item i of dataFields) ascending numeric by mykey() end repeat end sortBy on setIcons global gRevAppIcon,gRevSmallAppIcon put 1130 into gRevAppIcon put 1130 into gRevSmallAppIcon end setIcons function mykey add 1 to lLineCounter return line lLineCounter of lKeyData end mykey on savingstandalone set the uTopLeft of stack "textReaderData" to empty end savingstandalone function howMany ch,str -- returns how many instances of character ch are in string str put char 1 of ch into ch set the itemDelimiter to ch put (the number of items of str) - 1 into nbr if ch is char -1 of str then add 1 to nbr return nbr end howMany getProp writable if the locktext of the target = false and the traversalon of the target \ = true and the autohilite of the target = true then return true else return false end writable setProp writable which set the locktext of the target to not which set the traversalon of the target to which set the autohilite of the target to which end writable on setIcons global gRevAppIcon,gRevSmallAppIcon put 1130 into gRevAppIcon put 1130 into gRevSmallAppIcon end setIcons function sr str return word 1 to -1 of str end sr function q str return quote & str & quote end q function offsets str,ctr -- returns a comma-delimited list of all the offsets of str in ctr put "" into mosList put 0 into startPoint repeat put offset(str,ctr,startPoint) into os if os = 0 then exit repeat add os to startPoint put startPoint & "," after mosList end repeat if char -1 of mosList = "," then delete last char of mosList if mosList = "" then return "0" return mosList end offsets function lineOffsets str,ctr put offsets(str,ctr) into charList if charList = "0" then return "0" put the number of items of charList into nbr put "" into mlo repeat with n = 1 to nbr put the number of lines of (char 1 to (item n of charList) of ctr) & "," after mlo end repeat if char -1 of mlo = "," then delete char -1 of mlo return mlo end lineOffsets function wordOffsets str,ctr put offsets(str,ctr) into charList if charList = "0" then return "0" put the number of words of charList into nbr put "" into mlo repeat with n = 1 to nbr put the number of words of (char 1 to (item n of charList) of ctr) & "," after mlo end repeat if char -1 of mlo = "," then delete char -1 of mlo return mlo end wordOffsets function itemOffsets str,ctr put offsets(str,ctr) into charList if charList = "0" then return "0" put the number of items of charList into nbr put "" into mlo repeat with n = 1 to nbr put the number of items of (char 1 to (item n of charList) of ctr) & "," after mlo end repeat if char -1 of mlo = "," then delete char -1 of mlo return mlo end itemOffsets ^ Text Reader U Lucida Grande U Apple Braille Pinpoint 6 Dot U Apple Braille Pinpoint 6 Dot cRevStandaloneSettings 8scriptLibraries 'Browser Font Support Geometry Internet MacOSX true OSX,iconFile GR icons /GRlogo.icns OSX,name Gutenberg ReaderMacOS,documentType UNIX,fileSelector trueWindows trueMacOS,longVersion textReaderMain 1.0.0.0Windows,LegalCopyright #2008 All rights reserved worldwideUNIX,pageSetup trueOSX,documentType includeProfiles setToProfile Windows,documenticonFile inclusions selectWindows,copyright #2008 All rights reserved worldwide answerDialog trueOSX,documentExtension Windows,FileDescription $Gutenberg Reader 1.0.0.0 for WindowsOSX,longVersion Gutenberg Reader 1.0.0.0UNIX,printerChooser trueOSX,copyright #2008 All rights reserved worldwideWindows,buildU3 falseMacOS,shortVersion 1.0.0.0OSX,documentIconFile MacOS,MinimumSize 15000MacOS,versionnumber1 1MacOS,Release FinalMacOS,versionnumber2 0MacOS,versionnumber3 0name Gutenberg ReaderOSX,identifier com..Gutenberg ReadermoveSubstacks true MacOS,Region 1OSX,shortVersion 1.0.0.0Windows,fileversion1 1Windows,fileversion2 0Windows,productversion1 1Windows,fileversion3 0Windows,productversion2 0Windows,fileversion4 0Windows,productversion3 0cursors true OSX,info Gutenberg Reader Version 1.0.0.0Windows,productversion4 0MacOS,dynamicMemory trueMacOSX PowerPC-32 false askDialog trueWindows,iconFile GR icons /GRlogo.icoOSX,signature ????Windows,ProductName Gutenberg ReaderMacOS,PreferredSize 15000UNIX,colorChooser trueMacOSX x86-32 falseMacOS,creator ????Windows,companyname cREVGeneral scriptChecksum )n>Uh*&n debugObjects handlerList qsortBy mykey savingstandalone howMany writable writable setIcons sr q offsets lineOffsets wordOffsets itemOffsetsbreakpoints breakpointstates scriptSelection char 849 to 848scripteditorvscroll 0breakpointconditions bookmarks scripteditorselection 723tempScript prevHandler itemOffsetsstackfileversion 2.7script &
local lKeyData, lLineCounter
on sortBy keyField -- parallel sorting of linked flds
put fld keyField into lKeyData
put "ref,charList,descr,tChunk" into dataFields -- fill in your fld names here
repeat with i = 1 to the number of items of dataFields
put 0 into lLineCounter
sort lines of fld (item i of dataFields) ascending numeric by mykey()
end repeat
end sortBy
function mykey
add 1 to lLineCounter
return line lLineCounter of lKeyData
end mykey
on savingstandalone
set the uTopLeft of stack "textReaderData" to empty
end savingstandalone
function howMany ch,str
-- returns how many instances of character ch are in string str
put char 1 of ch into ch
set the itemDelimiter to ch
put (the number of items of str) - 1 into nbr
if ch is char -1 of str then add 1 to nbr
return nbr
end howMany
getProp writable
if the locktext of the target = false and the traversalon of the target \
= true and the autohilite of the target = true then return true
else return false
end writable
setProp writable which
set the locktext of the target to not which
set the traversalon of the target to which
set the autohilite of the target to which
end writable
on setIcons
global gRevAppIcon,gRevSmallAppIcon
put 1130 into gRevAppIcon
put 1130 into gRevSmallAppIcon
end setIcons
function sr str
return word 1 to -1 of str
end sr
function q str
return quote & str & quote
end q
function offsets str,ctr
-- returns a comma-delimited list of all the offsets of str in ctr
put "" into mosList
put 0 into startPoint
repeat
put offset(str,ctr,startPoint) into os
if os = 0 then exit repeat
add os to startPoint
put startPoint & "," after mosList
end repeat
if char -1 of mosList = "," then delete last char of mosList
if mosList = "" then return "0"
return mosList
end offsets
function lineOffsets str,ctr
put offsets(str,ctr) into charList
if charList = "0" then return "0"
put the number of items of charList into nbr
put "" into mlo
repeat with n = 1 to nbr
put the number of lines of (char 1 to (item n of charList) of ctr) & "," after mlo
end repeat
if char -1 of mlo = "," then delete char -1 of mlo
return mlo
end lineOffsets
function wordOffsets str,ctr
put offsets(str,ctr) into charList
if charList = "0" then return "0"
put the number of words of charList into nbr
put "" into mlo
repeat with n = 1 to nbr
put the number of words of (char 1 to (item n of charList) of ctr) & "," after mlo
end repeat
if char -1 of mlo = "," then delete char -1 of mlo
return mlo
end wordOffsets
function itemOffsets str,ctr
put offsets(str,ctr) into charList
if charList = "0" then return "0"
put the number of items of charList into nbr
put "" into mlo
repeat with n = 1 to nbr
put the number of items of (char 1 to (item n of charList) of ctr) & "," after mlo
end repeat
if char -1 of mlo = "," then delete char -1 of mlo
return mlo
end itemOffsets
Pon preopenstack set the visible of stack "textReaderMain" to false end preopenstack on preopenstack -- for uploading to RevOnline set the visible of stack "textReaderMain" to true set the blendlevel of stack "textReaderMain" to 0 end preopenstack on openstack set the blendlevel of stack "textReaderData" to 0 set the visible of stack "textReaderData" to true go stack "textReaderData" close stack "textReaderMain" end openstack on appleEvent pClass,pID,pSender switch (pClass & pID) case "aevtquit" send "doShutdownStuff" to card 1 of stack "textReaderData" pass appleEvent break default pass appleEvent break end switch end appleEvent cREVGeneral scriptChecksum 8AKuUbCbreakPoints handlerList !preopenstack openstack appleEventscriptSelection char 207 to 206 bookmarks scripteditorvscroll 0scripteditorselection 258tempScript prevHandler appleEventscripton preopenstack
set the visible of stack "textReaderMain" to false
end preopenstack
on openstack
set the blendlevel of stack "textReaderData" to 0
set the visible of stack "textReaderData" to true
go stack "textReaderData"
close stack "textReaderMain"
end openstack
on appleEvent pClass,pID,pSender
switch (pClass & pID)
case "aevtquit"
send "doShutdownStuff" to card 1 of stack "textReaderData"
pass appleEvent
break
default
pass appleEvent
break
end switch
end appleEvent
GRlogo-400.png PNG IHDR 6 pHYs .# .#x?v MiCCPPhotoshop ICC profile xڝSwX>eVBl "#Y a@Ņ VHUĂ H(gAZU\8ܧ}zy&j