STAK `PC " ` ` `ߞPT0T i""""""""̪3̪3 @"""""D"DĀ hC0&0 "U""U"U"UU"Uwwww݀UUUUH0 D9D"AA"A>"t"%2d$LA*@ @ "t"G"q]APP Script of stack Addresses with Audio Version 2.2 Copyright 1991,1993 by Apple Computer, Inc. THE MESSAGE HANDLERS USED IN THIS SCRIPT: openCard,openStack,closeStack,openBackground,resume,suspend,resumeStack, suspendStack,updateMenu,createtheMenu,unCheckItems, changeMenuItemStatus,setLocationCheckMark,goAddresses,goOverview, goSortPreferences,goMarkCards,deleteStackMenu,returnToAddressCard,toggleTip THE FUNCTION HANDLERS USED IN THIS SCRIPT: wrongStack,menuItemData,menuMsgData "--" indicates strings which will need localization on openStack -- Requires handlers: createTheMenu,wrongStack if not wrongStack() then createTheMenu pass openStack end openStack on closeStack -- Requires handlers: deleteStackMenu,wrongStack if not wrongStack() then deleteStackMenu pass closeStack end closeStack on openBackground -- Requires handlers: updateMenu,wrongStack if not wrongStack() then updateMenu pass openBackground end openBackground on closeBackground -- Requires handler: changeMenuItemStatus,wrongStack() -- enable all menu items if wrongStack() then pass closeBackground -- in case stackInUse if (short name of this bg is "Body") then push card -- Store current card for possible return else changeMenuItemStatus enable,"sort,misc,nav" pass closeBackground end closeBackground on resume -- Requires handlers: createTheMenu,wrongStack if not wrongStack() then updateMenu pass resume end resume on suspend -- Requires handlers: deleteStackMenu,wrongStack if not wrongStack() then deleteStackMenu pass suspend end suspend on resumeStack -- Requires handlers: createTheMenu,wrongStack if not wrongStack() then updateMenu pass resumeStack end resumeStack on suspendStack -- Requires handlers: deleteStackMenu,wrongStack if not wrongStack() then deleteStackMenu pass suspendStack end suspendStack function wrongStack -- in case stackInUse return (the value of word 2 of the long name of me is not line 1 of the stacks) end wrongStack ----- Menu Scripts ---------------------------------------------- on updateMenu -- Requires handlers: changeMenuItemStatus,createtheMenu, -- Requires handlers setLocationCheckMark,wrongStack createtheMenu if (short name of this bg is "Body") then setLocationCheckMark(Addresses) else changeMenuItemStatus disable,"sort,misc" unmark this card -- so export doesn't fail setLocationCheckMark(short name of this cd) end if end updateMenu on createTheMenu -- Requires function handlers: menuItemData,menuMsgData global StackMenu put "Utilities" into StackMenu -- -- remove any existing menus that might have the same name if there is a menu StackMenu then delete menu StackMenu create menu StackMenu put menuItemData() into menu StackMenu with menuMsg menuMsgData() end createTheMenu function menuItemData -- menu items for the Utilities menu return "Sort by Name,Sort by Company,Sort by City," & "Sort by State,Sort by Zip Code,-,Print Addresses," & "Import Text...,Export Text...,-,Addresses,Mark Cards," & "Sort Preferences,Stack Overview" -- end menuItemData function menuMsgData -- menu messages for the Utilities menu return "sortCards Name,sortCards Company,sortCards City," & "sortCards State,sortCards Zip,none,printReport,importText," & "exportText,none,goAddresses,goMarkCards,goSortPreferences,goOverview" end menuMsgData on changeMenuItemStatus status,theItems -- enables or disables menu items global StackMenu if there is no menu StackMenu then exit changeMenuItemStatus put (the short name of this bg is "Body") into update repeat with i = 1 to 9 set enabled of menuItem i of menu StackMenu to update end repeat end changeMenuItemStatus on unCheckItems -- removes all check marks associated with navigational menu items global StackMenu if there is no menu StackMenu then exit unCheckItems repeat with i = 11 to 14 set checkMark of menuItem i of menu StackMenu to false end repeat end unCheckItems on setLocationCheckMark locationMenu -- Requires handler: unCheckItems,menuItemData -- set check mark for current user location global StackMenu if wrongStack() then pass setLocationCheckMark unCheckItems if locationMenu is not in menuItemData() then put "Addresses" into locationMenu -- set the checkMark of menuItem locationMenu of menu StackMenu to true end setLocationCheckMark ----- Navigational Scripts ----------------------------------------- on goAddresses go bg "Body" end goAddresses on goOverview go cd "Stack Overview" end goOverview on goSortPreferences go cd "Sort Preferences" end goSortPreferences on goMarkCards go cd "Mark Cards" end goMarkCards on deleteStackMenu global StackMenu if StackMenu is in the menus then delete menu StackMenu put empty into StackMenu -- clean-up for exit end if end deleteStackMenu on returnToAddressCard pop cd into returnCard if the long name of this stack is in returnCard then go returnCard else goAddresses end returnToAddressCard ----- Misc. -------------------------------------------------------- on toggleTip visStatus,theField lock screen if visStatus then put "open" into theVisEffect -- card field id theField is a hidden field on this card set the scroll of cd fld id theField to 0 -- scroll to the top else put "close" into theVisEffect set the visible of cd fld id theField to visStatus set the hilite of cd btn "About Hiliter" to visStatus unlock screen with visual zoom theVisEffect end toggleTipll to t else put "close" into theVisEffect set the visible of cd fld id theField to visStatus set the hilite of cd btn MASTC ,DPʝ ?^ry'ViVRa lIwq_&LIST d\PAGE C` A 0  @H@ I@ H@H @PDHA &$B*@@ HVH@@CHJ@@@0p+a |nt '[2p̏ӇA`.o潜Ct&pJX:g:?㸻sۣ{=ng}w}[ןU-OuX;z7*?PBKGDP@VV#kz f&"d)U@ Name(a"'d>U@ Company("Hd_@ Street&b"^du@ City&c"td@ State$h"d@ Zip("r@ Phone 1(d"r@ Phone 2(e"r@ Phone 3(f"r@ Phone 4,Q (K Name Label.P .>K Company Label.O O_L Street Label,K euL City Label0R L Zip Code LabelZBct\= Phone Number 4on mouseUp dialNumber "Phone 4" end mouseUpZAct\= Phone Number 3on mouseUp dialNumber "Phone 3" end mouseUpZ'ct\= Phone Number 2on mouseUp dialNumber "Phone 2" end mouseUpZct\= Phone Number 1on mouseUp dialNumber "Phone 1" end mouseUp0S K Telephone LabelV)k1 Appointmentson mouseUp set cursor to watch put "Appointments" into theStack go stack theStack in new window -- get the result if it = "Cancel" then exit mouseUp if it empty then go stack theStack -- if the result empty then answer "Can't find stack" && quote & theStack & quote -- end if end mouseUpXhY Homeon mouseUp set cursor to watch go home end mouseUp 3- New Cardon mouseUp -- Requires handler: toggleMark -- create a new card and leaving the cursor into the name field toggleNotes false set lockMessages to true doMenu "New Card" toggleMark false select after text of bg field id 4 end mouseUp 4- Delete Cardon mouseUp -- Requires handler: deleteCurrentCard if the optionKey is down then doMenu "Delete Card" exit mouseUp end if if the number of cards in this bkgnd = 1 then answer "Can't delete the last address card." with "OK" -- exit to hyperCard end if answer "Delete this address card?" with "Cancel" or "OK" -- if it is "OK" then -- set cursor to watch get number of this card lock screen doMenu "Delete Card" go card it - 1 unlock screen end if end mouseUp 5\-o Findon mouseUp -- Requires handler: findText global AddressFind ask "What text do you want to find?" with AddressFind -- if it is empty then exit mouseUp else put it into AddressFind findText end if end mouseUp6s- Show Noteson mouseUp -- Requires handler: toggleNotes -- hide/show the Notes field toggleNotes (not visible of bkgnd field "Notes") end mouseUp .JLDC[] O Prevon mouseDown lock screen if the shiftKey is down then go prev marked cd else if the commandKey is down then go first cd of this bg else go prev cd of this bg unlock screen with visual wipe left fast end mouseDown on mouseStillDown -- Requires handler: mouseDown mouseDown end mouseStillDown JMDc[| Vn Nexton mouseDown lock screen if the shiftKey is down then go next marked cd else if the commandKey is down then go last cd of this bg else go next cd of this bg unlock screen with visual wipe right fast end mouseDown on mouseStillDown -- Requires handler: mouseDown mouseDown end mouseStillDown ]Zl&h Unmarkon mouseUp -- Requires handler: toggleMark toggleMark not marked of this card end mouseUpJ_ Sort orderon mouseUp hide me end mouseUpJ` Name Orderon mouseUp hide me end mouseUpzgPu on mouseUp -- Requires handler: toggleMark toggleMark not marked of this card end mouseUp,i {L State Label@ Noteson enterInField -- Requires handler toggleNotes toggleNotes (not visible of bkgnd field "Notes") end enterInField.k#dU Correct NameKCityPCompanyOStreetR Zip CodeS Telephone` last word_1QNameiStateBody Script from background "Body" of Addresses Stack Version 2.2 THE MESSAGE HANDLERS IN THIS SCRIPT: arrowKey,closeCard,deleteCurrentCard,dialNumber,enterKey,exportText, findText,importText,importTextFile,ImportTextFromNewStack, ImportTextFromOldStack,printReport,resetAPButtons,returnKey,openCard, sortCards,toggleMark,toggleNotes,whichStackVersion,writeExportedText, THE FUNCTION HANDLERS IN THIS SCRIPT: executeFind,getLabelContents,lastHCItem,nameOfThisCd,substituteChar, swapItemDelimiter,theFields "--" indicates strings which will need localization on openCard set the visible of bg btn "Unmark" to (not the marked of this cd) pass openCard end openCard on arrowKey whichKey if (whichKey is "Right") and (the shiftKey is down) then go next marked card if (whichKey is "left") and (the shiftKey is down) then go prev marked card else pass arrowKey end arrowKey on closeCard toggleNotes false pass closeCard end closeCard ----- Sort Handler ------------------------------------------------ on sortCards SortField if sortField is "Name" then sort cards of this bg international by nameOfThisCd() else sort cards of this bg international by bg fld sortField end sortCards function nameOfThisCd if bg fld "Name" is not empty then put bg fld "Name" into TheName if bg fld "Name Order" is "last word" then put number of words in TheName into TheNumber if TheNumber is 1 then put TheName into TheCorrectName else if TheNumber is 2 then put word 2 of TheName & "," && word 1 of TheName into TheCorrectName else put word 3 to TheNumber of TheName & "," && word 1 to 2 of TheName into TheCorrectName end if -- else put bg fld "Name" into TheCorrectName else put bg fld "Company" into TheCorrectName return TheCorrectName end nameOfThisCd ----- Find Handlers ------------------------------------------------ on findText -- Requires handler: toggleNotes global AddressFind if AddressFind is empty then exit findText find string AddressFind if the result is NOT empty then beep answer "" & AddressFind & " was not found." -- exit findText end if if the short name of the foundField is "Notes" then if not visible of bg fld "Notes" then set cursor to watch toggleNotes true find string AddressFind in bg fld "Notes" end if else if visible of bg fld "Notes" then set cursor to watch toggleNotes false find string AddressFind in the foundField end if end if end findText on returnKey if executeFind() then findText else pass returnKey end returnKey on enterKey if executeFind() then findText else pass enterKey end enterKey function executeFind -- Requires handler: findText -- if the cursor is not in a field or in the message box, then -- assume they want to find the text again. global AddressFind if (AddressFind is not empty) and (the selectedField is empty) then return TRUE else return FALSE end executeFind on doMenu what global AddressFind if what is "Find..." then put empty into AddressFind pass doMenu end doMenu ----- Misc Handlers ------------------------------------------------ on dialNumber whichFld -- dial the phone with a specified number. put bg fld whichFld into phoneNumber if phoneNumber is empty then ask "What phone number would you like dialed?" if the result is "Cancel" or it is empty then exit dialNumber put it into phoneNumber end if -- the dial handler is in the Phone Dialer stack if there is a stack "Phone Dialer" then lock screen push cd -- remember where we are go stack "Phone Dialer" -- if the result is empty then dial phoneNumber pop cd unlock screen end if else dial phoneNumber end dialNumber on toggleMark isMarked -- 'dog ear' the card to reflect its 'marked' status set the marked of this card to isMarked set the visible of bg btn "Unmark" to (not isMarked) end toggleMark on toggleNotes visStatus -- shows and hides the notes field lock screen set hilite of bg btn id 54 to visStatus set the visible of bg fld "Notes" to visStatus if visStatus then -- show it -- change the name of the btn to hide notes fld set the name of bg btn id 54 to "Hide Notes" -- put "wipe left fast" into theVisEffect select after text of bg fld "Notes" else -- hide it -- change the name of the btn to hide notes field set the name of bg btn id 54 to "Show Notes" -- put "wipe right fast" into theVisEffect end if unlock screen with visual effect theVisEffect end toggleNotes on printReport if the shiftKey is up then -- print all the cards put true into printAllCards put "addresses" into phrase -- else -- print only the marked cards put false into printAllCards put "marked cards" into phrase -- end if answer "Print all" && phrase && "as a name and address list or as an address book?" with "Cancel" or "List" or "Book" -- if it is "Cancel" then exit printReport -- else if it is "List" then put "Name and Address List" into theTemplate -- else if it is "Book" then put "Address Book" into theTemplate -- open report printing with template theTemplate -- go first card of bg "Body" if printAllCards then print (number of cards in bg "Body") cards else print marked cards close printing end printReport on dialNumber phoneNumber -- Requires handler: dial from the Phone Stack -- dial the phone using the Phone Dialer stack set cursor to watch if phoneNumber is empty then exit dialNumber push card -- remember where we are lock screen -- the 'dial' handler is in the 'Phone Dialer' stack if there is a stack "Phone Dialer" then -- go stack "Phone Dialer" -- dial phoneNumber -- dial the number else answer "The number could not be dialed, because the Phone Dialer stack cannot be found." -- pop card -- return to where we were unlock screen end dialNumber ----- Label Function ------------------------------- function getLabelContents -- Assembles information for print labels -- put empty into TheAddress -- put bg fld "Street" & return & bg fld "City" & ", " & bg fld "State" && bg fld "Zip" into TheAddress -- if bg fld "Company" is not empty then put bg fld "Company" & return before TheAddress end if -- if bg fld "Name" is not empty then put bg fld "Name" & return before TheAddress end if -- return TheAddress end getLabelContents ----- Import Text Operations ------------------------------- -- text files to be imported into the stack need to be in a specific -- format: chunks of information (such as Name, Company, -- etc.) should be separated by tabs on importText -- Requires handlers: importTextFromStack,importTextFile -- import text from a HyperCard 1.x or 2.x Address stack or from a text file answer "Import text from a text file or from an Address stack" && "(that shipped with a version of HyperCard)?" with "Cancel" or "Stack" or "Text File" -- if it is "Cancel" then exit importText -- if it is "Stack" then whichStackVersion -- else ImportTextFile end importText on ImportTextFile fileName -- Requires handler: toggleMark, deleteCurrentCard -- Requires function handler: theFields, SubstituteChar -- import text from a text file stored in the correct format if fileName is empty then answer file "Import text from what file?" of type "TEXT" -- if the result is "Cancel" or it is empty then exit ImportTextFile put it into fileName end if put theFields() into fieldList set cursor to busy go last card of bg "Body" -- adds the new cards to the end of the stack -- set lockRecent to true set lockMessages to true open file fileName put false into exitLoop repeat until exitLoop if the mouseClick then answer "Stop importing text?" with "No" or "Yes" -- if it is "Yes" then exit repeat -- end if set cursor to busy doMenu "New Card" toggleMark false repeat with fieldNum = 1 to (number of items in fieldList - 1) read from file fileName until tab if it is empty then -- out of text deleteCurrentCard -- delete the straggler put true into exitLoop exit repeat end if if last char of it is tab then delete last char of it do "put it into" && item fieldNum of fieldList end repeat if exitLoop then exit repeat read from file fileName until return put SubstituteChar("", return, it) into it do "put it into" && item fieldNum + 1 of fieldList end repeat close file fileName set lockRecent to false set lockMessages to false end ImportTextFile on whichStackVersion -- Requires handler: importTextFile -- Requires function handler: SubstituteChar, SwapItemDelimiter -- import text from the HyperCard 1.x Address stack. answer file "Import text from which Address stack?" of type "STAK" -- if it is empty or the result is "Cancel" then exit to hyperCard -- put it into exportStack put exportStack into fileName put SwapItemDelimiter(colon) into oldDelimiter delete last item of fileName set the itemDelimiter to oldDelimiter put fileName & ":HCAddressExportHC" into fileName put the long name of this stack into importStack push cd set cursor to busy set lockMessages to true set lockRecent to true go stack exportStack -- export all the other stacks data to a file then import into this stack -- put number of bg fields into numBgFields if numBgFields = 0 then answer "There are no background fields from which to export data!" -- exit to hyperCard end if -- version 1.2.5 or earlier if (there is a bg fld "Name and Address") and (there is a bg fld "Phone Number") and (there is a bg fld "Date") then ImportTextFromOldStack fileName else if there is a bg "Body" and hasCorrectFlds() then ImportTextFromNewStack fileName -- version 2.0 or later else answer "This stack has been modified or was" && "not shipped with a version of HyperCard." -- exit to HyperCard end if go to importStack unlock screen ImportTextFile fileName -- now import the file open file fileName write empty to file fileName -- empty out the temp file close file fileName pop cd end whichStackVersion function hasCorrectFlds put "Name,Company,Street,Zip,Phone 1,Phone 2,Phone 3,Phone 4,Notes" into list repeat with i = 1 to 9 if there is not a bg fld (item i of list) then return "False" end repeat put "false" into itExists if (there is a bg fld "CityState") then put "true" into itExists if (there is a bg fld "City") and (there is a bg fld "State") then put "true" into itExists if itExists is "false" then return "false" return "True" end hasCorrectFlds on ImportTextFromNewStack fileName -- collects from version 2.0 or later Addresses Stacks open file fileName repeat the number of cds of bg "Body" set cursor to busy put bg fld "Name" into theName -- name put bg fld "Company" into theCompany -- company put bg fld "Street" into theStreet -- street if there is a bg fld "CityState" then -- version 2.0v2 get bg fld "CityState" put item 1 of it into theCity -- city put item 2 of it into theState -- state if char 1 of theState is space then delete char 1 of theState end if else -- version 2.1 put bg fld "City" into theCity -- city put bg fld "State" into theState -- state end if put bg fld "Zip" into theZip -- Zip Code put empty into thePhones repeat with i = 1 to 4 put bg fld ("Phone" && i) & tab after thePhones end repeat put bg fld "Notes" into theNotes -- notes field put SubstituteChar(return, "", theNotes) into theNotes -- write theName & tab & theCompany & tab & theStreet & tab & theCity & tab & theState & tab & theZip & tab & thePhones & theNotes & return to file fileName go next cd of bg "Body" end repeat close file fileName end ImportTextFromNewStack on ImportTextFromOldStack fileName -- collects from version 1.2.5 or earlier Address Stacks open file fileName lock screen repeat the number of cards set cursor to busy put bg fld "Name and Address" into anAddress put the number of lines in anAddress into numLines repeat with lineNdx = 1 to the number of lines in anAddress if line lineNdx of anAddress = empty then exit repeat end repeat put empty into theNotes if lineNdx numLines then if lineNdx > 4 then put line lineNdx to 32000 of anAddress & return into theNotes delete line lineNdx to 32000 of anAddress put word 1 to 2000 of anAddress into anAddress -- strip blank lines put the number of lines in anAddress into numLines end if end if put line 1 of anAddress into theName -- Name if (numLines - 2) > 1 then -- if there's a third to last line, it's company put line (numLines - 2) of anAddress into theCompany if (numLines - 2) > 2 then put return & line 2 to (numLines - 3) of anAddress & return after theNotes -- department? end if else put empty into theCompany if numLines = 2 then put line 2 of anAddress into theStreet else if (numLines - 1) > 1 then -- if there's a second to last line, it's street put line (numLines - 1) of anAddress into theStreet -- street else put empty into theStreet put empty into thePhones repeat with phoneNdx = 1 to 4 put line phoneNdx of bg fld "Phone Number" & tab after thePhones end repeat if bg fld "Date" empty then put bg fld "Date" after theNotes -- move the date to the notes field end if put SubstituteChar(return, "", theNotes) into theNotes -- put empty into theCity put empty into theState put empty into theZip if numLines > 2 then put line numLines of anAddress into lastLine put last word of lastLine into lastWord if lastWord empty then if offset(lastWord, "/-+") = 0 then if value(lastWord) is a number then put lastWord into theZip delete last word of lastLine end if end if end if put item 1 of lastLine into theCity put word 1 of item 2 of lastLine into theState end if write theName & tab & theCompany & tab & theStreet & tab & theCity & tab & theState & tab & theZip & tab & thePhones & theNotes & return to file fileName go next card end repeat close file fileName end ImportTextFromOldStack ----- Export Text Operations ------------------------------------- on exportText -- Requires handler: writeExportedText -- Requires function handler: lastHCItem -- if shiftKey is down use only the marked cards if the shiftKey is down then put false into useAllCards put "from marked cards" & space into prompt -- put number of marked cards into numCards else put true into useAllCards put empty into prompt put number of cards in bg "Body" into numCards end if ask file "Export text" && prompt & "to the file:" with "Addresses Text File" -- if the result is "Cancel" or it is empty then exit exportText put it into fileName writeExportedText numCards, useAllCards, fileName if numCards = 1 then put "card" into info -- else put "cards" into info -- answer "The text from" && numCards && info && "was exported to the new file " & lastHCItem(":",fileName) & "." -- end exportText on writeExportedText numCards, useAllCards, fileName -- Requires function handler: theFields lock screen if useAllCards then go card 1 of bg "Body" else go first marked card put theFields() into fieldList open file fileName repeat with currentCard = 1 to numCards set cursor to busy put empty into theText repeat with i = 1 to (number of items in fieldList - 1) put value of (item i of fieldList) & tab after theText end repeat put SubstituteChar(return,"", value of (item i + 1 of fieldList)) & tab & return after theText write theText to file fileName if not useAllCards then go next marked card else go next card of this bg end repeat close file fileName unlock screen end writeExportedText ----- Utility Handlers -------------------------------------------- on deleteCurrentCard lock screen push prev cd doMenu "Delete Card" pop cd unlock screen end deleteCurrentCard function LastHCItem theDelim,theText -- returns the portion of that follows the last put SwapItemDelimiter(theDelim) into oldDelim put last item of theText into theResult set the itemDelimiter to oldDelim return theResult end LastHCItem function SubstituteChar origChar, newChar, theText -- returns theText with newChar substituted for all instances of origChar repeat put Offset(origChar, theText) into charPos if charPos = 0 then return theText put newChar into char charPos of theText end repeat end SubstituteChar function SwapItemDelimiter newDelim -- change the itemDelimiter, return the old delimiter for later resetting put the itemDelimiter into oldDelim set the itemDelimiter to newDelim return oldDelim end SwapItemDelimiter ----- Data Handlers ---------------------------------------------- function theFields return "bg fld id 4,bg fld id 97," & "bg fld id 6,bg fld id 98,bg fld id 99," & "bg fld id 104,bg fld id 8,bg fld id 100," & "bg fld id 101,bg fld id 102,bg fld id 7" end theFields`BMAP :(&"!! ꪪ! :! ! 1 sꪪ1 ;sUUUUUꥆ UUUUUUUP 꿆UUUUUUUP  ಆ ssUUUUU꿆 }}BKGDV)_HPP&jh on mouseUp send mouseUp to bg btn "Return To Addresses" -- end mouseUp,9\ Illuminate* !!Card Name, !Stack Name`  on mouseUp set the loc of me to 207,20 pass mouseUp end mouseUp  Return to Addresseson mouseUp -- Requires handler: returnToAddressCard returnToAddressCard end mouseUp  AddressesReturn to AddressesUtilitieson openCard -- Requires handlers: setLocationCheckMark setLocationCheckMark(short name of this cd) pass openCard end openCard `BMAP)_UUU!U!!@@D @TTTTTTTT T@TTTTpT8TTTT.TT@@D U!! T U@UCARDCP Jane DoeaAcme Dot Company12 Elm Streetb Other TowncMassachusettsh27111(617) 555-1212@Her birthday is September 24. Her FAX number is 555-1111.  CARD PA. Royce WalthropaAcme Sprockets1234 Main Streetb Some Townc Californiah95014(415) 555-1234 (work)SHis birthday is April 26. He used to work at Acme Dot Company. FAX: 555-1111 CARDHV@T""@S@ ""Re@ ""dw@ ""v@ ""@ ""@ "@ "@ d@R Name contains:on mouseUp hiliteAndSelect pass mouseUp end mouseUp fRd Company contains:on mouseUp hiliteAndSelect pass mouseUp end mouseUp fdv Street contains:on mouseUp hiliteAndSelect pass mouseUp end mouseUp dv City contains:on mouseUp hiliteAndSelect pass mouseUp end mouseUp d State contains:on mouseUp hiliteAndSelect pass mouseUp end mouseUp h Zip Code contains:on mouseUp hiliteAndSelect pass mouseUp end mouseUp h  Telephone contains:on mouseUp hiliteAndSelect pass mouseUp end mouseUp d Notes contains:on mouseUp hiliteAndSelect pass mouseUp end mouseUp " k~x@ "(=&, About'> Mark The Cardson mouseUp -- Requires function handler: theFields,thePhoneFields put false into shouldMark put "mark cards where (" into theMarkText repeat with i = 1 to 8 if ((hilite of cd btn i) and (cd fld i is not empty)) then if cd fld i contains quote then beep select text of cd fld i answer "Please do not use quotes." with "Thank You" -- exit mouseUp end if if i = 7 then repeat with n = 1 to 4 put "(" && item n of thePhoneFields() && "contains" && quote & cd fld i & quote && ")" && "or " after theMarkText put true into shouldMark end repeat if last word of theMarkText is "or" then delete last word of theMarkText put " and " after theMarkText else put "(" && item i of theFields() && "contains" && quote & cd fld i & quote && ")" && "and " after theMarkText put true into shouldMark end if end if end repeat if shouldMark then if last word of theMarkText is "and" then delete last word of theMarkText put ")" after theMarkText answer "Unmark all of the cards first?" with "No" or "Yes" -- if it is "Yes" then unmark all cards -- do theMarkText unmark card "Mark Cards" -- unmark card "Sort Preferences" -- unmark card "Stack Overview" -- else beep answer "Please click the appropriate checkbox(es)"&& "and fill in the corresponding blanks"&& "to determine which cards should be marked." -- exit to HyperCard end if put number of marked cards into totalCardsMarked put "Total number of cards marked:" && totalCardsMarked into prompt -- if totalCardsMarked = 0 then answer prompt else answer prompt & return & "Go to the first marked card?" with "Yes" or "Cancel" -- if it is "Yes" then go first marked card -- end if end mouseUp ----- Data Handlers ---------------------------------------------- function theFields return "bg fld id 4,bg fld id 97," & "bg fld id 6,bg fld id 98,bg fld id 99," & "bg fld id 104,bg fld id 8,bg fld id 7" end theFields function thePhoneFields return "bg fld id 8,bg fld id 100," & "bg fld id 101,bg fld id 102" end thePhoneFields About Hiliteron mouseUp -- Requires handler: toggleTip -- card field "Hidden" is a hidden field containing the tip info toggleTip (not the hilite of me),id of cd fld "Hidden" end mouseUp"   Hiddenon mouseUp -- Requires handler: toggleTip -- card field "Hidden" is a hidden field containing the tip info toggleTip false,id of cd fld "Hidden" end mouseUp Mark Cards Mark cards on which:Using Marked CardsTo mark all cards in Addresses that match specific criteria, click the appropriate check boxes on this card, fill in the corresponding blanks, then click "Mark the Cards". After you click "Mark the Cards", you will be asked whether or not you want to unmark all of the cards first. If you choose No, the newly marked cards will be added to the existing marked cards. The cards marked will include only those cards that match the checked criteria. Each criteria checked narrows the search. For example, selecting the "Name contains:" checkbox and entering a name in the corresponding blank will mark only those cards containing that name. If you then select the "Zip Code contains:" checkbox and enter a zip code, only those cards that contain both that name and that zip code will be marked. Heres how to navigate among, and use cards that are marked: To mark and unmark individual cards in Addresses, click the upper-right corner of the white area. After you mark a card, the corner looks like its folded over. To go to the previous marked card, hold down the Shift key and click the left arrow button. To go to the next marked card, hold down the Shift key and click the right arrow button. To print only the marked cards, hold down the Shift key and choose Print Addresses from the Utilities menu. To export text from only the marked cards, hold down the Shift key and choose Export Text from the Utilities menu. For more information about marked cards, see the HyperCard Help and HyperTalk Reference stacks.Mark Cardson closeCard -- Requires handler: toggleTip if visible of cd fld id 19 then toggleTip false,19 end closeCard on hiliteAndSelect if hilite of the target then select text of cd field (number of the target) end hiliteAndSelect CARD HV x""9  "?d  e$y First name firston mouseUp -- Requires handler: showExample set hilite of me to true set hilite of card button id 4 to false showExample end mouseUpy$ Last name firston mouseUp -- Requires handler: showExample set hilite of me to true set hilite of cd btn id 3 to false -- showExample end mouseUp"  $ Sort by first nameon mouseUp -- Requires handler: showExample set hilite of me to true set hilite of cd btn id 7 to false showExample end mouseUp$ Sort by last nameon mouseUp -- Requires handler: showExample set hilite of me to true set hilite of cd btn id 6 to false showExample end mouseUp"CWg@ ( W example&  CoverSort PreferencesL BTo indicate how the stack will sort names, complete items 1 and 2.< 1. How did you enter the names in this stack?, 2. When sorting the stack by name: Example:Steve Aaron Marti Belisle Loween Blank Emmett Cardenas Randy Fiscus Hillary Laurence Beverly Richie Charles Schmidt Throckmorton ScribblemongerSort Preferences Script from card "Sort Preferences" of the Addresses Stack THE MESSAGE HANDLERS USED IN THIS SCRIPT: closeCard,showExample THE FUNCTION HANDLERS USED IN THIS SCRIPT: sortingPreferences,firstNameFirstData,lastNameFirstData "--" indicates strings which will need localization on closeCard -- Requires function handler: sortingPreferences put sortingPreferences() into bg fld "Name Order" of first card of bg "Body" pass closeCard end closeCard function sortingPreferences -- return the preferences for sorting by name. if hilite of cd btn id 3 then -- if the hilite of cd btn id 6 -- then return "first word" else return "last word" else if the hilite of cd btn id 6 -- then return "last word" else return "first word" end if end sortingPreferences on showExample -- Requires function handlers:firstNameFirstData,lastNameFirstData if hilite of cd btn id 3 then get firstNameFirstData() if hilite of cd btn id 6 then sort it end if else get lastNameFirstData() if hilite of cd btn id 7 then sort it end if end if put it into cd fld "Example" end showExample function firstNameFirstData -- example names sorted alphabetically by last name return "Steve Aaron" & return & "Marti Belisle" & return & "Loween Blank" & return & "Emmett Cardenas" & return & "Randy Fiscus" & return & "Hillary Laurence" & return & "Beverly Richie" & return & "Charles Schmidt" & return & "Throckmorton Scribblemonger" end firstNameFirstData function lastNameFirstData -- example names sorted alphabetically by first name return "Richie, Beverly" & return & "Schmidt, Charles" & return & "Cardenas, Emmett" & return & "Laurence, Hillary" & return & "Blank, Loween" & return & "Belisle, Marti" & return & "Fiscus, Randy" & return & "Aaron, Steve" & return & "Scribblemonger, Throckmorton" end lastNameFirstDataCARD-HV &- About2"   About This Stack"   Hiddenon mouseUp -- Requires handler: toggleTip -- show/hide the tip info -- card field "Hidden" is a hidden field containing the tip info toggleTip (not visible of me),id of cd fld "Hidden" end mouseUp About Hiliteron mouseUp -- Requires handler: toggleTip -- card field "Hidden" is a hidden field containing the tip info toggleTip (not the hilite of me),id of cd fld "Hidden" end mouseUpStack Overview! About Transferring TextS&.1   l o     ! $ g j u x   F K         D I b c   b cAbout the Addresses Stack To print this field: 1. Choose "Print Field..." from the "File" menu 2. Click the "Card fields" button 3. Select "About this Stack" in the scrolling field 4. Click the "OK" button Purpose of this stack: You can use this stack to store names, addresses, phone numbers, notes, and even print labels. To add a new name and address: 1. Make sure you are in the Addresses section of this stack by selecting the "Addresses" menu item in the "Utilities" menu. 2. Click the "New Card" button 3. Fill in the appropriate lines on the card. 4. You may if you wish sort the cards To sort the Address cards in this stack: 1. Select the sorting option of your choice by selecting the appropriate menu item in the "Utilities" menu. To customize the sort options in this stack: 1. Select the "Sort Preferences" from the "Utilities" menu. To print the addresses: 1. If you are unsure as to which report template you will print with see the "About the report templates included in this stack" section (described later in this field). 2. If you are unsure about "Page Setup" options then see the "Page Setup for Particular Labels" section (described later in this field). 3. Next select "Print Report..." from the "File" menu. 4. Choose the correct report template for your needs from the "Reports" menu. 5. Click the "Print" button in the "Print Report..." dialog. About the report templates included in this stack: In addition to the "Name and Address List" and the "Address Book" templates, the Address stack now includes report templates for 15 of Avery Corporation's most popular labels. The report templates included in this stack are compatible with the following Avery label products: Laser Printer Sheet Fed Labels: Measurements Avery 5160 3 Across 1" x 2 5/8" Avery 5161 2 Across 1" x 4" Avery 5162 2 Across 1 1/3" x 4" Avery 5163 2 Across 2" x 4" Avery 5164 2 Across 3 1/3" x 4" Avery 5197 2 Across 1 1/2" x 4" Avery 5262 2 Across 1 1/3" x 4" Avery 5266 2 Across 2/3" x 3 7/16" Avery 5660 3 Across 1" x 2 5/6" Avery 5662 2 Across 1 1/3" x 4 1/4" Avery 5663 2 Across 2" x 4 1/4" Dot Matrix Printer Tractor Fed Labels: Avery 4143 2 Across 4" x 15/16" Avery 4144 3 Across 2 1/2" x 15/16" Avery 4145 1 Across 3 1/2" x 15/16" Avery 4161 1 Across 4" x 2 15/16" Printer compatibility: The Laser Printer sheet fed labels are compatible with the following printers: All Apple LaserWriters Apple StyleWriter HP DeskWriter HP LaserJet IIP The Dot Matrix Printer tractor fed labels are compatible with the following printers: ImageWriter ImageWriter II ImageWriter LQ Page Setup for Particular Labels: For the labels to print properly certain options must be set in the "Page Setup" dialog, (which can be found as a menu item under the "File" menu). For the Laser Printer sheet fed labels the settings are: Vertical (portrait orientation) US letter For the Dot Matrix Printer tractor fed labels the settings are: Vertical (portrait orientation) International Fanfold No Gaps Between Pages5The Utilities menu includes two menu items, "Export Text..." and "Import Text...", that help you transfer text between this stack, other stacks and application programs (such as word processors, databases, or spreadsheets). Export Text copies the addresses in this stack into a new text file. Import Text lets you select a text file (or the contents of an Address stack that came with an earlier version of HyperCard) to copy into this stack. Export Text creates a text file in the following format: Text is exported in the following order: Name, Company, Street, City, State, Zip Code, the four Phone fields, and Notes. Each field of text (including a blank field) is followed by a tab character. The last field is followed by a return character. If you use Import Text to copy information from a text file into this stack, make sure that the file uses the format described above. Every tenth tab character begins a new field, so the text file must include a tab character for every field in Addresses (including the four Phone fields), even if the field is blank. If the format is incorrect, the information will end up in the wrong fields. If you use Import Text to copy information from an old Address Stack, a text file called HCAddressExportHC will appear in the same folder as the old Address stack. You can delete this text file after the importing has been completed. Before using Import Text to copy your addresses, make sure that the name and the address on each card take up no more than three lines. Otherwise the address will not be copied properly. Only the name and address, phone number(s), and the date (which gets put into the Notes field) are copiedno other information on the original card is copied. If HyperCard is unable to correctly import your address into the current format, it will put "* See Notes" after the name field. Click on Show Notes to view the full information from the imported record. Note that return characters in the Notes field are imported and exported as ellipsis characters () to allow the return character to delimit a record.Stack Overviewon closeCard -- Requires handler: toggleTip set the scroll of cd fld "About This Stack" to 0 if visible of card field id 4 then toggleTip false,4 pass closeCard end closeCardSTBLi  @FTBL Palatino GenevaChicagont@PRNT n 0 H AHJpn=@Bg/NRg"g/N^Jm0f/ND/.֩p-@ n0HѮRni 0.noHB .Ю//.N R<Rnnl-Лg;nRLN^ _PONNVH0-HH:?<0 ??:Bg/-О0-Ф_H>0 <0mа??/-О-М Name and Address List2r ^ Address Book 2tN,$2r Avery 5160/5660 (1" x 2 5/8") Avery 5161 (1" x 4")IAvery 5162/5262 (1 1/3" x 4") Avery 5163/5663 (2" x 4"))ss) Avery 5164 (3 1/3") !qAvery 5197 (1 1/2" x 4") Avery 5262/5662 (1 1/3" x 4")rAvery 5266 (2/3" x 3 7/16)yAvery 4143 (4" x 15/16")WRAvery 4144 (2 1/2" x 15/16")"Avery 4145 (3 1/2" x 15/16")#Avery 4161 (4" x 2 15/16")w#Avery 4161 PRSTHH(FG(HH(d'@Cupertino, Califor`PRFT 4.J 7@$?/*X*X7/ ,w7/_@<.7@,@<7A7@7?7A7Ǣ7mp@<.7,t(6;p4H @@8x/ $j/m /77@J///*< field "Name"GenevabS< fld "Street" & return & fld "City" & ", "&fld "State" && fld "Zip"GenevaxS< fld "Phone 1" & return & fld "Phone 2" & return & fld "Phone 3" & return & fld "Phone 4"Geneva., field "Company"Geneva 3" & rePRFT^4  7@$?/*X*X7/ ,w7/_@<.7@,@<7A7@7?7A7Ǣ7mp@<.7,t(6;p4H @@8x/ $j/m /77@J///$ field "Name"d!Q<< field "Street" & return & field "City" && field "State" && field "Zip"Geneva"!2F "Address:"<=NF field "Telephone Label" & ":"Geneva8~=Qk< field "Phone 1" & return & field "Phone 2" & return & field "Phone 3" & return & field "Phone 4"Geneva&lyF "Notes:"Geneva,lQ < field "Notes"Geneva f cd`PRFT* /?aL !lH  ll @]lk! lB@F$hW ]@R@#]R@@@ mR]ml@ R@ 06< getLabelContents()Times "Company" `PRFT # DH@Ӭ0fh8MM` l4$H (2-up)Ӕ55I!Cancel55IDelete ) Ӥ o,t M3M`* :0 getLabelContents()& fld "Company" `PRFTI;; DP@Ӭ0fh8MM` l4$H (2-up)Ӕ55I!Cancel55IDelete ) Ӥ o,t M3M`* ; getLabelContents()& fld "Company" `PRFT$  Dlt "+MMcm@,@@WXlph@am !lHl  lLl@]lk0u getLabelContents()Geneva"Company" `PRFT 5 D@Ӭ0fh8MM` l4$H (2-up)Ӕ55I!Cancel55IDelete ) Ӥ o,t M3M`*5 getLabelContents()& fld "Company" `PRFT!qLA Dd@Ӭ0fh8MM` l4$H (2-up)Ӕ55I!Cancel55IDelete ) Ӥ o,t M3M`0 W< getLabelContents()Geneva"Company" `PRFT;; DP@Ӭ0fh8MM` l4$H (2-up)Ӕ55I!Cancel55IDelete ) Ӥ o,t M3M`* ; getLabelContents()& fld "Company" `PRFTr, 0)@Ӭ0fh8MM` l4$H (2-up)Ӕ55I!Cancel55IDelete ) Ӥ o,t M3M`0)< getLabelContents()Geneva"Company" `PRFTy2@Chjh8HH! $ l4x<h\ City" & fld "State" && fld "0+8< getLabelContents()Geneva"Company" `PRFTR$1 <Chjh8HH! $ l4x<h\ City" & fld "State" && fld "05, getLabelContents()Times "Company" `PRFT"$"> ?Chjh8HH! $ l4x<h\ City" & fld "State" && fld "08, getLabelContents()Times "Company" `PRFT# (  Chjh8HH! $ l4x<h\ City" & fld "State" && fld "*m" getLabelContents()& fld "Company" TAILNu r det slut