#!/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 "$@" Answer Dialog Patch 1 Non stripAndShip set the oldScript of btn "UnPatch" to "" end stripAndShip w U Tahoma U Tahoma W tahoma W tahoma U tahoma cREVGeneral scriptChecksum Pi?U+KIHi bookmarks handlerList stripAndShipscriptSelection prevHandler tempScript script
on stripAndShip
set the oldScript of btn "UnPatch" to ""
end stripAndShip
cREVGeometryCache stackID 1009 @ cREVGeometryCacheIDs 1133288615946 10081133287077849 10071133284872724 10041133284941316 1005 cREVGeometrycache order 1133288615946 total 4 Patch epon mouseUp answer question "This will patch and save the Answer Dialog" &cr& "Do you wish to continue?" with "Cancel" or "OK" if it is "Cancel" then exit to top get revAppVersion() if it is not in "2.6.1" then answer warning "This patch created for Rev 2.6 and/or 2.6.1" &cr& "Do you wish to continue?" with "Cancel" or "OK" if it is "Cancel" then exit to top end if get the script of cd 1 of stack "Answer Dialog" set the oldScript of btn "UnPatch" to it set the script of cd 1 of stack "Answer Dialog" to the patchedScript of me save this stack save stack "Answer Dialog" answer information "Dialog Patched!" end mouseUp 7) $ patchedScript )on preOpenStack global gAPKLargeFonts, gREVSmallAppIcon, gREVAppIcon --platform specific font adjustments set the defaultStack to "answer dialog" set the default of button 3 to false set the bottomRight of btn "icon 2" to -100,-100 switch the platform case "MacOS" if char 1 of the systemVersion is 1 then put true into tMacOSX set the loc of this stack to the screenLoc set the top of this stack to round(item 4 of the screenRect/5) repeat with i = 3 to the number of btns set the margins of btn i to 4 set the height of btn i to 23 end repeat if char 1 of the systemVersion is 1 then --OS X set the textFont of this stack to "Lucida Grande" set the textSize of this stack to 13 set the textSize of fld 1 to 13 put "210093 210092 210094 210093" into tIcons else set the textFont of this stack to "usesystemfont" set the textSize of this stack to 12 set the textFont of fld 1 to "Geneva" set the textSize of fld 1 to 10 put "210002 210001 210012 210009" into tIcons end if else set the loc of this stack to the screenLoc set the top of this stack to round(item 4 of the screenRect/5) repeat with i = 3 to the number of btns set the bottomMargin of btn i to 3 set the height of btn i to 20 end repeat if char 1 of the systemVersion is 1 then --OS X set the textFont of this stack to "Lucida Grande" set the textSize of this stack to 13 set the textSize of fld 1 to 13 put "210002 210001 210012 210009" into tIcons else set the textFont of this stack to "usesystemfont" set the textSize of this stack to 12 set the textFont of fld 1 to "Geneva" set the textSize of fld 1 to 10 put "210002 210001 210012 210009" into tIcons end if end if break case "Win32" if gAPKLargeFonts then put 26 into tNumber put 7 into tMargin else put 21 into tNumber put 5 into tMargin end if repeat with i = 3 to the number of btns set the bottomMargin of btn i to tMargin set the height of btn i to tNumber set the traversalOn of btn i to false set the mnemonic of btn i to 0 end repeat --> BELOW ADDED BY CHIPP WALTERS set the textFont of this stack to "Tahoma" set the textSize of this stack to 11 --> BELOW COMMENTED OUT BY CHIPP WALTERS #set the textFont of this stack to "MS Sans Serif" #set the textSize of this stack to 10 set the textFont of fld 1 to empty put "210005 210011 210003 210004" into tIcons break default repeat with i = 3 to the number of btns set the bottomMargin of btn i to 4 set the height of btn i to 22 set the traversalOn of btn i to false set the mnemonic of btn i to 0 end repeat set the textFont of this stack to "Helvetica" if gAPKLargeFonts then set the textSize of this stack to 14 else set the textSize of this stack to 12 set the textFont of fld 1 to empty put "210008 210010 210006 210010" into tIcons break end switch --is there an icon to display or not? set the itemDelimiter to numToChar(0) if word 2 of item 1 of the dialogData is "plain" and (not tMacOSX and gREVAppIcon is not empty) then set the loc of btn 1 to -100,21 put 0 into tIconAllowance else set the loc of btn 1 to 26,33 put wordOffset(word 2 of item 1 of the dialogData, "information error warning question") into tIconWord set the icon of button "icon" to word tIconWord of tIcons if tMacOSX then put 87 into tIconAllowance set the loc of btn "icon" to 52,44 -- top is also set later so this is ignored if tIconWord is 0 then --large app icon set the icon of btn "icon" to gREVAppIcon else --small app icon set the icon of btn "icon 2" to gREVSmallAppIcon set the itemDel to comma set the loc of btn "icon 2" to item 1 of the loc of btn "icon" + 16,item 2 of the loc of btn "icon" + 21 set the itemDel to numToChar(0) end if else put 40 into tIconAllowance end if end if --title if item 2 of the dialogData is empty then set the title of this stack to space else set the title of this stack to item 2 of the dialogData put item 3 of dialogData into tText if "" is in tText or matchChunk(tText, "<(.+>.+") then set the htmlText of fld 1 to tText else set the text of fld 1 to tText if the platform is "MacOS" and not tMacOSX then set the textFont of fld 1 to "usesystemfont" set the textSize of fld 1 to 12 end if --buttons put item 4 of dialogData into tButtonNames put the number of lines in tButtonNames into tNoOfButtons if tButtonNames is empty then put "OK" into tButtonNames put 1 into tNoOfButtons end if put 32 into tTotalBtnWidth --truncate more buttons to the maximum allowed (7) if tNoOfButtons > the number of buttons - 2 then put the number of buttons - 2 into tNoOfButtons put empty into tMnemonicString repeat with i = 3 to (tNoOfButtons + 3) -- put "got here 1" && i && tNoOfButtons --set the loc of btn i to the cPrevLoc of btn i --show btn set the name of button i to line tNoOfButtons - (i - 3) of tButtonNames -- put "got here 2" && i if the platform is "Win32" and the short name of btn i is not in "OKCancel" then -- put "got here 3" && i put 0 into tNo --put "got here 4" && i repeat for each char x in the short name of btn i -- put "got here 5" && i add 1 to tNo -- put "got here 6" && i if x is not in tMnemonicString then -- put "got here 7" && i put x after tMnemonicString -- put "got here 8" && i set the mnemonic of btn i to tNo -- put "got here 9" && i exit repeat -- put "got here 10" && i end if -- put "got here 11" && i end repeat -- put "got here 12" && i end if set the width of button i to 82 -- put "got here 13" && i if the width of btn i < the formattedWidth of btn i +28 then set the width of btn i to the formattedWidth of btn i + 28 -- put "got here 14" && i add the width of button i + 12 to tTotalBtnWidth -- put "got here 15" && i end repeat set the dontWrap of field 1 to true if tMacOSX then put 4 into tFieldSubtract else put 0 into tFieldSubtract put the formattedWidth of fld 1 into t put max(the formattedWidth of field 1 + tIconAllowance + 16, tTotalBtnWidth)+tFieldSubtract into tWidth -- Fix integrated if tWidth < 400 then put 400 into tWidth end if if tTotalBtnWidth > 450 then put tTotalBtnWidth into tWidth set the width of field 1 to twidth - tIconAllowance - 16 set the dontWrap of field 1 to false else if tWidth > 450 then put 450 into twidth set the width of field 1 to twidth - tIconAllowance - 16 set the dontWrap of field 1 to false --> ADDED BY CHIPP WALTERS put the formattedWidth of fld 1 into tNewWidth if tNewWidth > 450 then put max(the formattedWidth of field 1 + tIconAllowance + 16, tTotalBtnWidth)+tFieldSubtract into tWidth set the width of field 1 to twidth - tIconAllowance - 16 end if --> END ADDED BY CHIPP WALTERS end if put the width of this stack into oldwidth set the width of this stack to twidth -- set the top of button 1 to the height of field 1 div 2 - 12 if tMacOSX then set the top of btn 1 to 18 else set the top of btn 1 to 6 set the itemDel to comma -- Fix applied by Sarah Reichelt: Sept 12th, 2005 -- get the rect of fld 1 -- put (the width of this stack - 12) into item 3 of it -- set the rect of fld 1 to it if tMacOSX then put 5 into tAddition else put 0 into tAddition put the width of this stack -12 - tAddition into tStartRight put the formattedHeight of field 1 + 58 into tHeight if tHeight > 400 then set the vScrollbar of field 1 to true put 400 into tHeight else set the vScrollbar of field 1 to false set the height of this stack to tHeight set the height of field 1 to tHeight - 58 set the topLeft of field 1 to tIconAllowance + 8, 12 if the platform is "MacOS" then if tMacOSX then put 6 into tAddition else put 0 into tAddition repeat with i = 3 to tNoOfButtons + 2 set the right of btn i to tStartRight subtract the width of btn i + 10 from tStartRight set the bottom of btn i to the height of this stack - 12 - tAddition if i is 5 and tNoOfButtons is 3 and word 1 of the short name of btn i is "Don't" then --move don't save to the left set the left of btn i to the left of fld 1+5 end if end repeat else repeat with i = (tNoOfButtons + 2) down to 3 set the right of btn i to tStartRight subtract the width of btn i + 12 from tStartRight set the bottom of btn i to the height of this stack - 12 set the traversalOn of btn i to true end repeat end if if the platform is "MacOS" then set the top of this stack to round(item 4 of the screenRect/5) set the default of button 3 to true end preOpenStack on commandKeyDown pKey if pKey is "." then if there is a btn "Cancel" then click at the loc of btn "cancel" exit commandKeyDown end if end if repeat with i = 3 to the number of btns if item 1 of the loc of btn i < 1 then next repeat if char 1 of the short name of btn i is pKey then set the hilite of btn i to true wait 50 milliseconds set the hilite of btn i to false send "mouseUp" to btn i exit repeat end if end repeat end commandKeyDown on escapeKey if there is a btn "cancel" then click at the loc of btn "cancel" end escapeKey on closeStack revCleanUpAnswerDialog end closeStack on revCleanUpAnswerDialog --show invisibles compatible removal of btns repeat with i = 3 to the number of buttons set the cPrevLoc of btn i to the loc of btn i set the loc of btn i to -100,-100 end repeat set the dialogData to empty end revCleanUpAnswerDialog on mouseUp if the name of the target contains "button" then lock messages--prevents user stack getting refocusing messages close this stack revCleanUpAnswerDialog--won't get closeStack unlock messages set the dialogData to the short name of the target end if end mouseUp on returnKey pass returnKey to top end returnKey Patch Answer Dialog cREVGeneral scriptChecksum 7qy1hA! bookmarks revUniqueID 1133284872724handlerList mouseUpscriptSelection char 608 to 607prevHandler mouseUptempScript script R
on mouseUp
answer question "This will patch and save the Answer Dialog" &cr& "Do you wish to continue?" with "Cancel" or "OK"
if it is "Cancel" then exit to top
get revAppVersion()
if it is not in "2.6.1" then
answer warning "This patch created for Rev 2.6 and/or 2.6.1" &cr& "Do you wish to continue?" with "Cancel" or "OK"
if it is "Cancel" then exit to top
end if
get the script of cd 1 of stack "Answer Dialog"
set the oldScript of btn "UnPatch" to it
set the script of cd 1 of stack "Answer Dialog" to the patchedScript of me
save this stack
save stack "Answer Dialog"
answer information "Dialog Patched!"
end mouseUp
UnPatch epon mouseUp put "defaultScript" into tWhichScript if the oldScript of btn "UnPatch" is not empty then answer question "Un-Patch with virgin copy of 2.6.1 script or with previously saved script?" with \ "2.6.1" or "Previously Saved" or "Cancel" if it is "Previously Saved" then put "prevSaved" into tWhichScript if it is "Cancel" then exit to top end if if tWhichScript is "defaultScript" then set the script of cd 1 of stack "Answer Dialog" to the Script261 of me else set the script of cd 1 of stack "Answer Dialog" to the oldScript of me end if save stack "Answer Dialog" close stack "Answer Dialog" answer information "Un-Patch Successful!" end mouseUp 7N $ oldScript Script261 'Zon preOpenStack global gAPKLargeFonts, gREVSmallAppIcon, gREVAppIcon --platform specific font adjustments set the defaultStack to "answer dialog" set the default of button 3 to false set the bottomRight of btn "icon 2" to -100,-100 switch the platform case "MacOS" if char 1 of the systemVersion is 1 then put true into tMacOSX set the loc of this stack to the screenLoc set the top of this stack to round(item 4 of the screenRect/5) repeat with i = 3 to the number of btns set the margins of btn i to 4 set the height of btn i to 23 end repeat if char 1 of the systemVersion is 1 then --OS X set the textFont of this stack to "Lucida Grande" set the textSize of this stack to 13 set the textSize of fld 1 to 13 put "210093 210092 210094 210093" into tIcons else set the textFont of this stack to "usesystemfont" set the textSize of this stack to 12 set the textFont of fld 1 to "Geneva" set the textSize of fld 1 to 10 put "210002 210001 210012 210009" into tIcons end if else set the loc of this stack to the screenLoc set the top of this stack to round(item 4 of the screenRect/5) repeat with i = 3 to the number of btns set the bottomMargin of btn i to 3 set the height of btn i to 20 end repeat if char 1 of the systemVersion is 1 then --OS X set the textFont of this stack to "Lucida Grande" set the textSize of this stack to 13 set the textSize of fld 1 to 13 put "210002 210001 210012 210009" into tIcons else set the textFont of this stack to "usesystemfont" set the textSize of this stack to 12 set the textFont of fld 1 to "Geneva" set the textSize of fld 1 to 10 put "210002 210001 210012 210009" into tIcons end if end if break case "Win32" if gAPKLargeFonts then put 26 into tNumber put 7 into tMargin else put 21 into tNumber put 5 into tMargin end if repeat with i = 3 to the number of btns set the bottomMargin of btn i to tMargin set the height of btn i to tNumber set the traversalOn of btn i to false set the mnemonic of btn i to 0 end repeat set the textFont of this stack to "MS Sans Serif" set the textSize of this stack to 10 set the textFont of fld 1 to empty put "210005 210011 210003 210004" into tIcons break default repeat with i = 3 to the number of btns set the bottomMargin of btn i to 4 set the height of btn i to 22 set the traversalOn of btn i to false set the mnemonic of btn i to 0 end repeat set the textFont of this stack to "Helvetica" if gAPKLargeFonts then set the textSize of this stack to 14 else set the textSize of this stack to 12 set the textFont of fld 1 to empty put "210008 210010 210006 210010" into tIcons break end switch --is there an icon to display or not? set the itemDelimiter to numToChar(0) if word 2 of item 1 of the dialogData is "plain" and (not tMacOSX and gREVAppIcon is not empty) then set the loc of btn 1 to -100,21 put 0 into tIconAllowance else set the loc of btn 1 to 26,33 put wordOffset(word 2 of item 1 of the dialogData, "information error warning question") into tIconWord set the icon of button "icon" to word tIconWord of tIcons if tMacOSX then put 87 into tIconAllowance set the loc of btn "icon" to 52,44 -- top is also set later so this is ignored if tIconWord is 0 then --large app icon set the icon of btn "icon" to gREVAppIcon else --small app icon set the icon of btn "icon 2" to gREVSmallAppIcon set the itemDel to comma set the loc of btn "icon 2" to item 1 of the loc of btn "icon" + 16,item 2 of the loc of btn "icon" + 21 set the itemDel to numToChar(0) end if else put 40 into tIconAllowance end if end if --title if item 2 of the dialogData is empty then set the title of this stack to space else set the title of this stack to item 2 of the dialogData put item 3 of dialogData into tText if "" is in tText or matchChunk(tText, "<(.+>.+") then set the htmlText of fld 1 to tText else set the text of fld 1 to tText if the platform is "MacOS" and not tMacOSX then set the textFont of fld 1 to "usesystemfont" set the textSize of fld 1 to 12 end if --buttons put item 4 of dialogData into tButtonNames put the number of lines in tButtonNames into tNoOfButtons if tButtonNames is empty then put "OK" into tButtonNames put 1 into tNoOfButtons end if put 32 into tTotalBtnWidth --truncate more buttons to the maximum allowed (7) if tNoOfButtons > the number of buttons - 2 then put the number of buttons - 2 into tNoOfButtons put empty into tMnemonicString repeat with i = 3 to (tNoOfButtons + 3) -- put "got here 1" && i && tNoOfButtons --set the loc of btn i to the cPrevLoc of btn i --show btn set the name of button i to line tNoOfButtons - (i - 3) of tButtonNames -- put "got here 2" && i if the platform is "Win32" and the short name of btn i is not in "OKCancel" then -- put "got here 3" && i put 0 into tNo --put "got here 4" && i repeat for each char x in the short name of btn i -- put "got here 5" && i add 1 to tNo -- put "got here 6" && i if x is not in tMnemonicString then -- put "got here 7" && i put x after tMnemonicString -- put "got here 8" && i set the mnemonic of btn i to tNo -- put "got here 9" && i exit repeat -- put "got here 10" && i end if -- put "got here 11" && i end repeat -- put "got here 12" && i end if set the width of button i to 82 -- put "got here 13" && i if the width of btn i < the formattedWidth of btn i +28 then set the width of btn i to the formattedWidth of btn i + 28 -- put "got here 14" && i add the width of button i + 12 to tTotalBtnWidth -- put "got here 15" && i end repeat set the dontWrap of field 1 to true if tMacOSX then put 4 into tFieldSubtract else put 0 into tFieldSubtract put max(the formattedWidth of field 1 + tIconAllowance + 16, tTotalBtnWidth)+tFieldSubtract into tWidth -- Fix integrated if tWidth < 400 then put 400 into tWidth end if if tTotalBtnWidth > 450 then put tTotalBtnWidth into tWidth set the width of field 1 to twidth - tIconAllowance - 16 set the dontWrap of field 1 to false else if tWidth > 450 then put 450 into twidth set the width of field 1 to twidth - tIconAllowance - 16 set the dontWrap of field 1 to false end if put the width of this stack into oldwidth set the width of this stack to twidth -- set the top of button 1 to the height of field 1 div 2 - 12 if tMacOSX then set the top of btn 1 to 18 else set the top of btn 1 to 6 set the itemDel to comma -- Fix applied by Sarah Reichelt: Sept 12th, 2005 -- get the rect of fld 1 -- put (the width of this stack - 12) into item 3 of it -- set the rect of fld 1 to it if tMacOSX then put 5 into tAddition else put 0 into tAddition put the width of this stack -12 - tAddition into tStartRight put the formattedHeight of field 1 + 58 into tHeight if tHeight > 400 then set the vScrollbar of field 1 to true put 400 into tHeight else set the vScrollbar of field 1 to false set the height of this stack to tHeight set the height of field 1 to tHeight - 58 set the topLeft of field 1 to tIconAllowance + 8, 12 if the platform is "MacOS" then if tMacOSX then put 6 into tAddition else put 0 into tAddition repeat with i = 3 to tNoOfButtons + 2 set the right of btn i to tStartRight subtract the width of btn i + 10 from tStartRight set the bottom of btn i to the height of this stack - 12 - tAddition if i is 5 and tNoOfButtons is 3 and word 1 of the short name of btn i is "Don't" then --move don't save to the left set the left of btn i to the left of fld 1+5 end if end repeat else repeat with i = (tNoOfButtons + 2) down to 3 set the right of btn i to tStartRight subtract the width of btn i + 12 from tStartRight set the bottom of btn i to the height of this stack - 12 set the traversalOn of btn i to true end repeat end if if the platform is "MacOS" then set the top of this stack to round(item 4 of the screenRect/5) set the default of button 3 to true end preOpenStack on commandKeyDown pKey if pKey is "." then if there is a btn "Cancel" then click at the loc of btn "cancel" exit commandKeyDown end if end if repeat with i = 3 to the number of btns if item 1 of the loc of btn i < 1 then next repeat if char 1 of the short name of btn i is pKey then set the hilite of btn i to true wait 50 milliseconds set the hilite of btn i to false send "mouseUp" to btn i exit repeat end if end repeat end commandKeyDown on escapeKey if there is a btn "cancel" then click at the loc of btn "cancel" end escapeKey on closeStack revCleanUpAnswerDialog end closeStack on revCleanUpAnswerDialog --show invisibles compatible removal of btns repeat with i = 3 to the number of buttons set the cPrevLoc of btn i to the loc of btn i set the loc of btn i to -100,-100 end repeat set the dialogData to empty end revCleanUpAnswerDialog on mouseUp if the name of the target contains "button" then lock messages--prevents user stack getting refocusing messages close this stack revCleanUpAnswerDialog--won't get closeStack unlock messages set the dialogData to the short name of the target end if end mouseUp on returnKey pass returnKey to top end returnKey Un-Patch Answer Dialog cREVGeneral scriptChecksum 2qطbg|8 bookmarks revUniqueID 1133284941316handlerList mouseUpscriptSelection char 369 to 368prevHandler mouseUptempScript script
on mouseUp
put "defaultScript" into tWhichScript
if the oldScript of btn "UnPatch" is not empty then
answer question "Un-Patch with virgin copy of 2.6.1 script or with previously saved script?" with \
"2.6.1" or "Previously Saved" or "Cancel"
if it is "Previously Saved" then put "prevSaved" into tWhichScript
if it is "Cancel" then exit to top
end if
if tWhichScript is "defaultScript" then
set the script of cd 1 of stack "Answer Dialog" to the Script261 of me
else
set the script of cd 1 of stack "Answer Dialog" to the oldScript of me
end if
save stack "Answer Dialog"
close stack "Answer Dialog"
answer information "Un-Patch Successful!"
end mouseUp
Test Dialog Ep on mouseUp answer information the altMsg of me with "Yes" or "No" if it is "No" then answer information "Please apply patch" if it is "Yes" then answer information "No need to apply patch" end mouseUp 7 $ altMsg TThis tests to see if the current Answer dialog is capable of displaying long strings of characters without spaces.
Below is the above sentence without spaces. Can you read it?
ThisteststoseeifthecurrentAnswerdialogiscapableofdisplayinglongstringsofcharacterswithoutspaces.