-- background: 2079 from stack: in -- bmap block id: 2772 -- flags: 0000 -- background id: 0 -- name: RefCard ----- HyperTalk script ----- on openBackground hide message box hide bkgnd button id 53 hide bkgnd button id 68 hide bkgnd button id 69 hide bkgnd button id 73 hide bkgnd button id 74 hide bkgnd button "Next" hide bkgnd button "Prev." end openBackground on openCard get the short name of this stack put it into bkgnd field id 48 end openCard -- part 6 (field) -- low flags: 00 -- high flags: 0000 -- rect: left=101 top=67 right=106 bottom=441 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Author -- part 10 (field) -- low flags: 00 -- high flags: 0000 -- rect: left=101 top=105 right=150 bottom=438 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Title -- part 12 (field) -- low flags: 00 -- high flags: 0000 -- rect: left=101 top=153 right=198 bottom=434 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Publication -- part 13 (field) -- low flags: 00 -- high flags: 0000 -- rect: left=101 top=202 right=247 bottom=436 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Notes -- part 16 (field) -- low flags: 00 -- high flags: 0000 -- rect: left=101 top=252 right=292 bottom=384 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Keywords -- part 28 (button) -- low flags: 00 -- high flags: 2004 -- rect: left=14 top=309 right=337 bottom=51 -- title width / last selected line: 0 -- icon id / first selected line: 21700 / 21700 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Home ----- HyperTalk script ----- on mouseUp visual iris close to black visual iris open go home end mouseUp -- part 31 (button) -- low flags: 00 -- high flags: 2004 -- rect: left=213 top=309 right=337 bottom=251 -- title width / last selected line: 0 -- icon id / first selected line: 32462 / 32462 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Help ----- HyperTalk script ----- on mouseUp push card visual scroll down fast to gray visual scroll up fast go to card id 2892 of stack "HyperSource Help" end mouseUp -- part 32 (button) -- low flags: 00 -- high flags: A004 -- rect: left=89 top=313 right=334 bottom=163 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: NoteCard ----- HyperTalk script ----- on mouseUp if the cmdKey is down then push card go card id 5716 of "HyperSource Help" exit mouseUp end if if the optionKey is down then push card go "HyperSource Notes" exit mouseUp end if put the name of this stack into thisStack set lockscreen to true get field 1 && field 2 if field 1 = empty then go HyperSource Notes exit mouseUp end if put it into Ref push card visual iris open go HyperSource Notes find Ref in field 1 if the result is not empty then --if no notecard exists pop card answer "No NoteCard exists; shall I create one?" with "OK" or "Cancel" if it is "OK" then set lockscreen to false put "N" into field "Indic" visual iris open go HyperSource Notes doMenu "New Card" put Ref into field "NoteHeader" end if end if end mouseup -- part 33 (button) -- low flags: 00 -- high flags: 2004 -- rect: left=388 top=309 right=337 bottom=421 -- title width / last selected line: 0 -- icon id / first selected line: 30557 / 30557 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: First Card ----- HyperTalk script ----- on mouseUp set lockMessages to true visual wipe right go to first card end mouseUp -- part 34 (button) -- low flags: 00 -- high flags: 2004 -- rect: left=420 top=309 right=337 bottom=452 -- title width / last selected line: 0 -- icon id / first selected line: 26865 / 26865 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Last Card ----- HyperTalk script ----- on mouseUp visual wipe left go to last card end mouseUp -- part 35 (button) -- low flags: 00 -- high flags: 0001 -- rect: left=389 top=270 right=293 bottom=421 -- title width / last selected line: 0 -- icon id / first selected line: 1014 / 1014 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Previous Card ----- HyperTalk script ----- on mouseUp visual effect wipe right go to previous card end mouseUp -- part 36 (button) -- low flags: 00 -- high flags: 0001 -- rect: left=419 top=270 right=293 bottom=448 -- title width / last selected line: 0 -- icon id / first selected line: 1013 / 1013 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Next Card ----- HyperTalk script ----- on mouseUp visual effect wipe left go to next card end mouseUp -- part 48 (field) -- low flags: 01 -- high flags: 2000 -- rect: left=306 top=33 right=50 bottom=451 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 65535 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Stack Name -- part 51 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=18 top=285 right=300 bottom=35 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Indic -- part 53 (button) -- low flags: 80 -- high flags: 8000 -- rect: left=373 top=247 right=269 bottom=448 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Copying ... -- part 54 (button) -- low flags: 00 -- high flags: 2004 -- rect: left=299 top=309 right=337 bottom=346 -- title width / last selected line: 0 -- icon id / first selected line: 32670 / 32670 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: showCards ----- HyperTalk script ----- on mouseUp if the cmdKey is down then push card go card id 13853 of "HyperSource Help" exit mouseUp end if --show all cards repeat go next card wait 20 if the mouse is down then exit repeat end repeat end mouseUp -- part 63 (button) -- low flags: 00 -- high flags: A004 -- rect: left=457 top=56 right=80 bottom=510 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Import ----- HyperTalk script ----- on mouseUp if the cmdKey is down then push card go card id 7005 of "HyperSource Help" exit mouseUp end if push card ask "Import text from which file?" if it is empty then exit mouseUp put it into fileName open file fileName show bkgnd button id 74 set lockscreen to true set cursor to 4 go last card repeat doMenu "New Card" repeat with i = 1 to 5 read from file fileName until tab if it is empty then if i = 1 then doMenu "Delete Card" close file fileName go last card if field 1 is empty then doMenu "Delete Card" pop card set lockscreen to false hide bkgnd button id 74 exit mouseUp end if put empty into last char of it put it into field i end repeat end repeat close file fileName go last card if field 1 is empty then doMenu "Delete Card" pop card set lockscreen to false hide bkgnd button id 74 end mouseUp -- part 64 (button) -- low flags: 00 -- high flags: A004 -- rect: left=457 top=85 right=109 bottom=510 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Export ----- HyperTalk script ----- on mouseUp if the cmdKey is down then push card go card id 8204 of "HyperSource Help" exit mouseUp end if global fileName put the short name of this stack & ".txt" into fileName ask "Export text to what file?" with fileName if it is empty then exit mouseUp put it into fileName answer "Number of fields to include?" with "Three" or "Five" or "Cancel" if it is "Three" then doThree if it is "Five" then doFive end mouseUp on doThree global fileName open file fileName show bkgnd button id 73 set lockscreen to true set cursor to 4 push card go to first card of bkgnd Refcard repeat for the number of cards repeat with y = 1 to 3 if return is in field y then repeat put offset (return, field y) into retLoc if retLoc = 0 then exit repeat delete char retLoc of field y end repeat end if end repeat put field 1 && field 2 && field 3 into exRef write exRef to file fileName write return & return to file fileName go next card if the short name of this card = "Title" then exit repeat end repeat pop card set lockscreen to false hide bkgnd button id 73 close file fileName end doThree on doFive global fileName open file fileName show bkgnd button id 73 set lockscreen to true set cursor to 4 push card go to first card of bkgnd Refcard repeat for the number of cards repeat with y = 1 to 5 if return is in field y then repeat put offset (return, field y) into retLoc if retLoc = 0 then exit repeat delete char retLoc of field y end repeat end if end repeat put field 1 && field 2 && field 3 && "[" & field 4 && field 5 & "]" into exRef write exRef to file fileName write return & return to file fileName go next card if the short name of this card = "Title" then exit repeat end repeat pop card set lockscreen to false hide bkgnd button id 73 close file fileName end doFive -- part 65 (button) -- low flags: 00 -- high flags: A004 -- rect: left=457 top=114 right=138 bottom=510 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Delete ----- HyperTalk script ----- on mouseUp if the cmdKey is down then push card go card id 8577 of "HyperSource Help" exit mouseUp end if ask "Delete how many cards?" if it is "all" then doAll exit mouseup else put it into Num if Num is empty then exit mouseUp set lockscreen to true set cursor to 4 repeat for Num times doMenu "Delete Card" end repeat end if end mouseUp on doAll set lockscreen to true set cursor to 4 put the number of cards into Num go third card repeat for Num - 2 doMenu "Delete Card" end repeat end doAll -- part 66 (button) -- low flags: 00 -- high flags: A004 -- rect: left=457 top=172 right=196 bottom=510 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Sort ----- HyperTalk script ----- on mouseUp if the cmdKey is down then push card go card id 6909 of "HyperSource Help" exit mouseUp end if global sortKey,numKey answer "Sort reference cards according to:" with "Author" or "Keywords" or "Cancel" set lockscreen to true set cursor to 4 if it is "Author" then sort by bkgnd field "Author" go second card end if if it is "Keywords" then ask "Enter Keywords (separate with commas):" put it into sortKey if sortKey = empty then exit mouseUp put the number of items in sortKey into numKey if numKey > 1 then answer "Match any or all?" with "Any" or "All" if it is "All" then allMatch else anyMatch exit mouseUp else anyMatch end if if it is "Cancel" then exit mouseUp end mouseUp on anyMatch global sortKey,numKey,holdCard,endSearch,holdNum,matchNum put empty into holdNum put empty into holdCard put empty into endSearch repeat with x = 1 to the number of items in sortKey find item x of sortKey --find first match if the result is not empty then if x = numKey then play "Boing" answer "No matches found" exit anyMatch else next repeat end if get the short name of this card if it = "Title" then go next card next repeat end if put short name of this card into endSearch put short name of this card & "," into holdCard exit repeat end repeat repeat with y = 1 to the number of items in sortKey repeat --find other matches go next card find item y of sortKey if the result is not empty then exit repeat get short name of this card put it into holdNum if holdNum = endSearch then exit repeat if holdNum = "Title" then next repeat if holdNum is in holdCard then exit repeat else put holdNum & "," after holdCard end repeat end repeat delete last char of holdCard set cursor to 1 put the number of items in holdCard & " match(es). " into matchNum put "View or Copy or Export?" into Question answer matchNum & Question with "View" or "Copy" or "Export" if it is "View" then displayCard if it is "Copy" then copyCard if it is "Export" then exportData end anyMatch on allMatch global sortKey,numKey,holdCard,allKey,matchNum put empty into holdCard put empty into allKey repeat with y = 1 to the number of items in sortKey put item y of sortKey & space after allKey end repeat find allKey if the result is not empty then play "Boing" answer "Sorry. No matches found." exit allMatch end if get the short name of this card if it = "Title" then go next card next repeat end if put short name of this card & "," into holdCard repeat go next card find allKey get short name of this card if it = "Title" then next repeat if it is in holdCard then exit repeat else put it & "," after holdCard end repeat delete last char of holdCard set cursor to 1 put the number of items in holdCard & " match(es). " into matchNum put "View or Copy or Export?" into Question answer matchNum & Question with "View" or "Copy" or "Export" if it is "View" then displayCard if it is "Copy" then copyCard if it is "Export" then exportData end allMatch on displayCard global holdCard,matchNum,countMatch go to first item in holdCard put 1 into countMatch if countMatch = the number of items in holdCard then exit displayCard else show bkgnd button "Next" show bkgnd button "Prev." end if end displayCard -- part 67 (button) -- low flags: 00 -- high flags: A004 -- rect: left=457 top=201 right=226 bottom=510 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Select ----- HyperTalk script ----- on mouseUp global thisStack,newStack,authorVar,titleVar,pubVar,notesVar,keyVar if the cmdKey is down then push card go card id 6277 of "HyperSource Help" exit mouseUp end if put the name of this stack into thisStack show bkgnd button id 68 show bkgnd button id 69 push card answer "Put selected cards into ..." with "New stack" or "Existing one" or "Cancel" if it is "Cancel" then hide bkgnd button id 68 hide bkgnd button id 69 exit mouseUp end if set lockScreen to true if it is "New stack" then set lockMessages to true doMenu "New Stack..." put the name of this stack into newStack if newStack = thisStack then hide bkgnd button id 68 hide bkgnd button id 69 exit mouseUp end if pop card end if if it is "Existing one" then set lockMessages to true doMenu "Open Stack..." put the name of this stack into newStack if newStack = thisStack then hide bkgnd button id 68 hide bkgnd button id 69 exit mouseUp end if pop card end if end mouseUp -- part 68 (button) -- low flags: 80 -- high flags: A004 -- rect: left=457 top=231 right=255 bottom=510 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Copy ----- HyperTalk script ----- on mouseUp global authorVar,titleVar,pubVar,notesVar,keyVar repeat with x = 1 to the number of fields if return is in field x then repeat put offset (return, field x) into retLoc if retLoc = 0 then exit repeat delete char retLoc of field x end repeat end if end repeat put field 1 & return after authorVar put field 2 & return after titleVar put field 3 & return after pubVar put field 4 & return after notesVar put field 5 & return after keyVar end mouseUp -- part 69 (button) -- low flags: 80 -- high flags: A004 -- rect: left=457 top=260 right=284 bottom=510 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Done ----- HyperTalk script ----- on mouseUp global authorVar,titleVar,pubVar,notesVar,keyVar,newStack,thisStack if authorVar = empty then hide bkgnd button id 68 hide bkgnd button id 69 exit mouseUp end if show bkgnd button id 53 set lockscreen to true set cursor to 4 push card go last card of newStack repeat with x = 1 to the number of lines in authorVar doMenu "New Card" put line x of authorVar into field 1 put line x of titleVar into field 2 put line x of pubVar into field 3 put line x of notesVar into field 4 put line x of keyVar into field 5 end repeat put empty into authorVar put empty into titleVar put empty into pubVar put empty into notesVar put empty into keyVar pop card set lockscreen to false answer "Go to stack with selected cards?" with "OK" or "Cancel" if it is "OK" then set lockscreen to true go last card of newStack if field "Author" is empty then doMenu "Delete Card" go first card of bkgnd Refcard of newStack if field "Author" is empty then doMenu "Delete Card" set lockscreen to false hide bkgnd button id 68 hide bkgnd button id 69 end if end mouseUp -- part 73 (button) -- low flags: 80 -- high flags: 8000 -- rect: left=362 top=247 right=269 bottom=448 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Exporting ... -- part 74 (button) -- low flags: 80 -- high flags: 8000 -- rect: left=362 top=247 right=269 bottom=448 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Importing ... -- part 75 (button) -- low flags: 00 -- high flags: A004 -- rect: left=457 top=143 right=167 bottom=510 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Find ----- HyperTalk script ----- on mouseUp if the cmdKey is down then push card go card id 11196 of "HyperSource Help" exit mouseUp end if doMenu "Find..." end mouseUp -- part 76 (button) -- low flags: 80 -- high flags: A004 -- rect: left=457 top=232 right=257 bottom=510 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Next ----- HyperTalk script ----- on mouseUp global holdNum,holdCard,countMatch add 1 to countMatch get item countMatch of holdCard go to it if countMatch = the number of items in holdCard then wait 20 answer "This is the last match" with "Copy" or "Export" or "Cancel" if it is "Copy" then copyCard if it is "Export" then exportData else hide bkgnd button "Next" hide bkgnd button "Prev." end if end if end mouseUp -- part 77 (button) -- low flags: 80 -- high flags: A004 -- rect: left=458 top=263 right=288 bottom=511 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Prev. ----- HyperTalk script ----- on mouseUp global holdCard,countMatch subtract 1 from countMatch get item countMatch of holdCard go to it if it = item 1 of holdCard then answer "This is the first match" with "OK" end if end mouseUp