#!/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 "$@" = AskDialog2 2Managing Ask Dialogs ULucida Grande WLucida Grande ULucida Grande ULucida Grande UGeorgiaUGeorgia @ULucida Grande UVerdana @UVerdana UVerdana UCourier UCourier cREVGeneral debugObjects pon preOpenStack set the style of this stack to "modeless" set the loc of this stack to the screenLoc end preOpenStack ------------------------------------ on preOpenCard put the scriptTextFont into tFont if tFont = empty then switch the platform case "MacOS" set the textFont of fld "Script" to "Courier" break case "Win32" set the textFont of fld "Script" to "Courier New" break default set the textFont of fld "Script" to "Helvetica" end switch else set the textFont of fld "Script" to tFont set the textSize of fld "Script" to 12 end preOpenCard ------------------------------------ on rawKeyUp BuildCode -- set the enabled of btn "Show Dialog" to fld "Text" <> empty set the enabled of btn "Copy" to fld "Script" <> empty pass rawKeyUp end rawKeyUp ------------------------------------ on BuildCode if fld "Text" = empty then put empty into fld "Script" else put fld "Text" into tPrompt repeat with i = 1 to the number of lines of tPrompt put quote & line i of tPrompt & quote into line i of tPrompt if i > 1 then put " & cr & " before line i of tPrompt end repeat replace cr with " \" & cr in tPrompt put "put " before tPrompt put " into tPrompt" after tPrompt put cr & "ask" && the hilitedButtonName of grp "radio" && "tPrompt" after tPrompt if fld "Default" <> empty then put " with" && quote & fld "Default" & quote after tPrompt if fld "Title" <> empty then put " titled" && quote & fld "Title" & quote after tPrompt if the hilite of btn "Sheet" then put " as sheet" after tPrompt replace " &" && quote & quote & ""with empty in tPrompt put tPrompt & cr into fld "Script" revColorScript -- end if end BuildCode ------------------------------------------------ on revColorScript global gREVScriptColors if gREVScriptColors["if"] is empty then revSetupColors put field "script" into tScript put 1 into tCurrentWord lock screen set the textColor of word 1 to -1 of fld "script" to empty -- remove any colors in use repeat for each word w in tScript --block comment color if char 1 to 2 of w is "/*" then put true into tBlockComment end if if tBlockComment then if char 1 to 2 of w is "*/" then set the textColor of word tCurrentWord of fld "script" to "DarkOrchid4" put false into tBlockComment else set the textColor of word tCurrentWord of fld "script" to "DarkOrchid4" add 1 to tCurrentWord next repeat end if end if if char 1 of w is quote then set the textColor of word tCurrentWord of field "script" to empty add 1 to tCurrentWord next repeat end if if gREVScriptColors[token 1 of w] is not empty then set the textColor of token 1 of word tCurrentWord of field "script" to gREVScriptColors[token 1 of w] end if add 1 to tCurrentWord end repeat put min(lineoffset("#", tScript), lineoffset("--", tScript)) into tOldLine if tOldLine is 0 then put max(lineoffset("#", tScript), lineoffset("--", tScript)) into tOldLine put 0 into tLineNo repeat -- while tOldLine is not 0 if tOldLine is 0 then exit repeat add tOldLine to tLineNo put line tLineNo of tScript into tCurrentLine put the number of words in tCurrentLine into tNumWords repeat with tCurrentWord = 1 to tNumWords if char 1 of word tCurrentWord of tCurrentLine is "#" or char 1 to 2 of word tCurrentWord of tCurrentLine is "--" then put the number of words in tCurrentLine into tNumWords set the textColor of word tCurrentWord to tNumWords of line tLineNo of field "script" to "DarkOrchid4" exit repeat end if end repeat put min(lineoffset("#", tScript, tLineNo), lineoffset("--", tScript, tLineNo)) into tOldLine if tOldLine is 0 then put max(lineoffset("#", tScript, tLineNo), lineoffset("--", tScript, tLineNo)) into tOldLine end repeat unlock screen end revColorScript ------------------------------------------------ on revSetupColors global gREVScriptColors delete global gREVScriptColors put the cCustomColorsList of stack "revPreferences" into tColorsList put line 1 of the cBuiltInColors of stack "revPreferences" into tColor replace "command" with tColor in tColorsList repeat for each word w in the commandNames put tColor into gREVScriptColors[w] end repeat put line 2 of the cBuiltInColors of stack "revPreferences" into tColor replace "Control Structure" with tColor in tColorsList repeat for each word w in "if then else repeat for with while on end switch case getprop setprop try catch" put tColor into gREVScriptColors[w] end repeat put line 3 of the cBuiltInColors of stack "revPreferences" into tColor replace "Functions" with tColor in tColorsList repeat for each word w in the functionNames put tColor into gREVScriptColors[w] end repeat put line 4 of the cBuiltInColors of stack "revPreferences" into tColor replace "Property" with tColor in tColorsList repeat for each word w in the propertyNames put tColor into gREVScriptColors[w] end repeat put 1 into tCount put the cCustomWordList of stack "revPreferences" into tWordsList repeat for each line l in tWordsList put line tCount of tColorsList into gREVScriptColors[l] add 1 to tCount end repeat end revSetupColors ------------------------------------------------ on AnswerFramedPage pAction -- as an example; not used in this stack put "

This page uses frames:" & cr & "Can't retrieve relevant data from such an architecture." \ & cr & cr & "To" && pAction && "this reference manually:" & cr \ & cr & "1. Create a .txt file" \ & cr & "2. Put the URL into the first line of it" \ & cr & "3. Paste the contents of the page" \ & cr & "4. Name the file as you wish" \ & cr & "5. Drop the file into your local folder

" into tPrompt replace cr with "

" & cr & "

" in tPrompt -- that is the trick :-) answer error tPrompt as sheet end AnswerFramedPage  cREVGeneralscriptChecksumo$ً0.꫐u bookmarks handlerListZpreOpenStack preOpenCard rawKeyUp BuildCode revColorScript revSetupColors AnswerFramedPage tempScript prevHandlerrawKeyUpscriptSelectionchar 175 to 174script>

on preOpenStack

set the style of this stack to "modeless"

set the loc of this stack to the screenLoc

end preOpenStack

------------------------------------

on preOpenCard

put the scriptTextFont into tFont

if tFont = empty then

switch the platform

case "MacOS"

set the textFont of fld "Script" to "Courier"

break

case "Win32"

set the textFont of fld "Script" to "Courier New"

break

default

set the textFont of fld "Script" to "Helvetica"

end switch

else set the textFont of fld "Script" to tFont

set the textSize of fld "Script" to 12

end preOpenCard

------------------------------------

on rawKeyUp

BuildCode -- 

set the enabled of btn "Show Dialog" to fld "Text" <> empty

set the enabled of btn "Copy" to fld "Script" <> empty

pass rawKeyUp

end rawKeyUp

------------------------------------

on BuildCode

if fld "Text" = empty then put empty into fld "Script"

else

put fld "Text" into tPrompt

repeat with i = 1 to the number of lines of tPrompt

put quote & line i of tPrompt & quote into line i of tPrompt

if i > 1 then put " & cr & " before line i of tPrompt

end repeat

replace cr with " \" & cr in tPrompt

put "put " before tPrompt

put " into tPrompt" after tPrompt

put cr & "ask" && the hilitedButtonName of grp "radio" && "tPrompt" after tPrompt

if fld "Default" <> empty then put " with" && quote & fld "Default" & quote after tPrompt

if fld "Title" <> empty then put " titled" && quote & fld "Title" & quote after tPrompt

if the hilite of btn "Sheet" then put " as sheet" after tPrompt

replace " &" && quote & quote & ""with empty in tPrompt

put tPrompt & cr into fld "Script"

revColorScript -- 

end if

end BuildCode

------------------------------------------------

on revColorScript

global gREVScriptColors

if gREVScriptColors["if"] is empty then revSetupColors

put field "script" into tScript

put 1 into tCurrentWord

lock screen

set the textColor of word 1 to -1 of fld "script" to empty -- remove any colors in use

repeat for each word w in tScript

--block comment color

if char 1 to 2 of w is "/*" then

put true into tBlockComment

end if

if tBlockComment then

if char 1 to 2 of w is "*/" then

set the textColor of word tCurrentWord of fld "script" to "DarkOrchid4"

put false into tBlockComment

else

set the textColor of word tCurrentWord of fld "script" to "DarkOrchid4"

add 1 to tCurrentWord

next repeat

end if

end if

if char 1 of w is quote then

set the textColor of word tCurrentWord of field "script" to empty

add 1 to tCurrentWord

next repeat

end if

if gREVScriptColors[token 1 of w] is not empty then

set the textColor of token 1 of word tCurrentWord of field "script" to gREVScriptColors[token 1 of w]

end if

add 1 to tCurrentWord

end repeat

put min(lineoffset("#", tScript), lineoffset("--", tScript)) into tOldLine

if tOldLine is 0 then put max(lineoffset("#", tScript), lineoffset("--", tScript)) into tOldLine

put 0 into tLineNo

repeat -- while tOldLine is not 0

if tOldLine is 0 then exit repeat

add tOldLine to tLineNo

put line tLineNo of tScript into tCurrentLine

put the number of words in tCurrentLine into tNumWords

repeat with tCurrentWord = 1 to tNumWords

if char 1 of word tCurrentWord of tCurrentLine is "#" or char 1 to 2 of word tCurrentWord of tCurrentLine is "--" then

put the number of words in tCurrentLine into tNumWords

set the textColor of word tCurrentWord to tNumWords of line tLineNo of field "script" to "DarkOrchid4"

exit repeat

end if

end repeat

put min(lineoffset("#", tScript, tLineNo), lineoffset("--", tScript, tLineNo)) into tOldLine

if tOldLine is 0 then put max(lineoffset("#", tScript, tLineNo), lineoffset("--", tScript, tLineNo)) into tOldLine

end repeat

unlock screen

end revColorScript

------------------------------------------------

on revSetupColors

global gREVScriptColors

delete global gREVScriptColors

put the cCustomColorsList of stack "revPreferences" into tColorsList

put line 1 of the cBuiltInColors of stack "revPreferences" into tColor

replace "command" with tColor in tColorsList

repeat for each word w in the commandNames

put tColor into gREVScriptColors[w]

end repeat

put line 2 of the cBuiltInColors of stack "revPreferences" into tColor

replace "Control Structure" with tColor in tColorsList

repeat for each word w in "if then else repeat for with while on end switch case getprop setprop try catch"

put tColor into gREVScriptColors[w]

end repeat

put line 3 of the cBuiltInColors of stack "revPreferences" into tColor

replace "Functions" with tColor in tColorsList

repeat for each word w in the functionNames

put tColor into gREVScriptColors[w]

end repeat

put line 4 of the cBuiltInColors of stack "revPreferences" into tColor

replace "Property" with tColor in tColorsList

repeat for each word w in the propertyNames

put tColor into gREVScriptColors[w]

end repeat

put 1 into tCount

put the cCustomWordList of stack "revPreferences" into tWordsList

repeat for each line l in tWordsList

put line tCount of tColorsList into gREVScriptColors[l]

add 1 to tCount

end repeat

end revSetupColors

------------------------------------------------

on AnswerFramedPage pAction -- as an example; not used in this stack

put "<p><b>This page uses frames:</b>" & cr & "Can't retrieve relevant data from such an architecture." \

& cr & cr & "To" && pAction && "this reference manually:" & cr \

& cr & "<i>1. Create a .txt file" \

& cr & "2. Put the URL into the first line of it" \

& cr & "3. Paste the contents of the page" \

& cr & "4. Name the file as you wish" \

& cr & "5. Drop the file into your local folder</i></p>" into tPrompt

replace cr with "</p>" & cr & "<p>" in tPrompt -- that is the trick :-)

answer error tPrompt as sheet

end AnswerFramedPage

#!%@  346'= Show DialogEpon mouseUp do fld "Script" if it = empty then put "it variable is empty" else put "it variable contains:" && it end mouseUp d cREVGeneral scriptChecksumu]~pp:G handlerListmouseUp breakPointsscriptSelection char 76 to 75 revUniqueID 1113288937307 bookmarks tempScript prevHandlermouseUpscript

on mouseUp

do fld "Script"

if it = empty then put "it variable is empty"

else put "it variable contains:" && it

end mouseUp

Script)h @#KV cREVGeneral revUniqueID 1113288980608  (put "Enter your nickname:" into tPrompt @blue $ 6ask info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I=88hY X"=G1"978H3X˄ ۦ { nfh !l8t~C)yyޞoՙoo-Hu,k-Te5ʈfFK\{Hpehu?" GDÆGZK'h?D⡕B>,,7ug'H= `ı} /Q@60,lk1'!l"F?M!H \2nha?h"?͈+#Ă'?[BX?Z'$V} e@)ii@:TZVJ@, \͌o'zM[{@D}3<bhT``4Ӥ(IENDB` cREVGeneralscriptChecksum`}^.e revUniqueID 1113291554833 bookmarks handlerList mouseDown tempScript prevHandlerscriptSelection char 13 to 12script

on mouseDown

revGoUrl "http://www.sosmartsoftware.com"

end mouseDown

 Commands i%~  cREVGeneral revUniqueID 1113297858120  Text)`@#Y"y cREVGeneral bookmarks revUniqueID 1113292456037 handlerListscriptSelection char 4 to 4 prevHandler tempScriptscript  Enter your nickname: `4Zh*a$ InfoIconbB@]#" cREVGeneral revUniqueID 1113293876997   warningIconbB@"#  cREVGeneral revUniqueID 1113294094450   ErrorIconbB@!"  cREVGeneral revUniqueID 1113294123655  Radioi+on mouseUp BuildCode -- C end mouseUp e]o cREVGeneralscriptChecksum|Tzn` bookmarks revUniqueID 1113294653773 handlerListmouseUpscriptSelection char 29 to 28 prevHandler tempScriptscript

on mouseUp

BuildCode -- C

end mouseUp

info`@ia cREVGeneral revUniqueID 1113293867980 warning`@i cREVGeneral revUniqueID 1113294609789 error`@i cREVGeneral revUniqueID 1113294613623 Sheet`eeon mouseUp --set the enabled of grp "Title" to not the hilite of me BuildCode -- C end mouseUp )Display as sheet (Mac OS X) cREVGeneralscriptChecksum5OY0d7͠ revUniqueID 1113297775725 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 16 to 15script

on mouseUp

--set the enabled of grp "Title" to not the hilite of me

BuildCode -- C

end mouseUp

Titlei]1 cREVGeneral revUniqueID 1113298787159  Label Field #@ cREVGeneral revUniqueID 1113297647468 Title: Title)p$on returnInField end returnInField @#" cREVGeneralscriptChecksumSMDƨ( bookmarks revUniqueID 1113297647513 handlerList returnInFieldscriptSelection char 35 to 34 prevHandler returnInField tempScriptscriptr

on returnInField

end returnInField

 Login 7 Label Field jp cREVGeneral revUniqueID 1113382760148 Default Answer: 8Default)p%on returnInField end returnInField @j cREVGeneralscriptChecksum|x..Sv9)S ` bookmarks revUniqueID 1113382760158 handlerList returnInFieldscriptSelectionchar 116 to 115 prevHandler tempScriptscriptz

on returnInField

end returnInField

 Jimmy  StyleLabel #.j cREVGeneral revUniqueID 1113298182143 on mouseUp

put the selectedChunk into tChunk

select text of fld "Script"

copy

wait 20 milliseconds

if tChunk = empty then select empty

else do "select" && tChunk

end mouseUp

# Tab Menu}on menuPick pItem lock screen set the visible of fld "Info" to pItem = "Discussion" set the visible of btn "Print" to pItem = "Discussion" unlock screen end menuPick ~Action Discussion cREVGeneralscriptChecksum*4p΁vEK9q bookmarks revUniqueID 1113300355119 handlerListmenuPickscriptSelectionchar 161 to 160 prevHandlermenuPick tempScriptscript

on menuPick pItem

lock screen

set the visible of fld "Info" to pItem = "Discussion"

set the visible of btn "Print" to pItem = "Discussion"

unlock screen

end menuPick

% Label Field #4d cREVGeneral revUniqueID 1113300832798 Code:@ Flche2.png  PNG  IHDR Kpl_ pHYs  gAMA|Q cHRMz%u0`:o_FIDATxb?,Xv$ϯ.?~~e'P#@11 @?~23_k_?V@p /÷>|()%ţ,%-F2\@ *n w JU牓/_ o_ū(II` b`AM]Nk5 _ ,?d+@021~K?@fӬ ~W XXY};w<||| ߿}Kw^W@koǑ74;Gڷo_߿uLL7qe`&Fqϟ_sPuFFfbA8`(10r=zk~ TxNP`=l|,IENDB` cREVGeneral revUniqueID 1113305569943 error rduit.png B##PNG  IHDR##ٳY pHYs  gAMA|Q cHRMz%u0`:o_FIDATxb`@ lwd` # Ģ@, 3f12cvRARb9xAfr1D59UX9Cd %IB9 4:!@ :wAwt4s @1kG !cjCO3@:aԸ&s|^\4rZ@1q/A>r1c:ʕ+ 1ȍ@ <b7?;^b!P@<@i(ß-[@ C& @d;b6Li w̶mcEr3z &cDӓ'$B2Dc~T=P? G@1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l_;ߡK{b|@Ĝ@ RUK?@ dNj.gŤX &r@L$ ӭ#,'ma,M v29C HrjfpAVm.)ļPǰb":T9 p@;o^fu 1d@!y?:U8 5N'lyԀu@1es%Pǀr;9@8o 6H (wcUZW 64Q.A ʩ'~PE B )Kת+B :Fl5 [w $&4!)P9 L+ma ֿ TY]Y$0t|Py`jq @!қ &rI !ʖ_HaPu*R'ʂ ,L/1Uh&Dz#+t w?쯇H!xZd@au+01DuL&Po'i 0Ce>D cρx 6#u%y :$@a8x5+3pAl8 0<``0͈  &re . "[d~ ,gI;ć@1a s@f| 8@1,RB ie n vB059K00:w #(T :UCA åvf1:I+ AjX(2*A$?*vb @H5+H `$^a.@+ 4_2WH}jBCVjOA  L>݂`$-:`!N8 s>v!TC L 5/Q`Er@,Oeʘ?A>!R_Ԯ ѷo W+92r\ ՜iSEq?_sg5Za\1WQ/_x~V*v3?ǞB=#?b"pC:b%TeGP# 9 X3&(;41S1;E@K g"U(r@,H.%3Rvc3`(&bă<-H Mp6w2IENDB` cREVGeneral revUniqueID 1113317835864 3 Label Field #DG cREVGeneral revUniqueID 1113318486981 Prompt: 4 Label Field DG cREVGeneral revUniqueID 1113318514005 Icon: 6@^n cREVGeneral revUniqueID 1113382192061 0This code builder provides a simple Ask dialog: pSee the Dicussion pane to know how to repeat such a dialog until the user input matches what it is expected... 'Infopon rawKeyUp end rawKeyUp ------------------------ on linkClicked pLink switch pLink case "Execute this code" AskZIPCode -- break case "Execute this code " AskZIPCode2 -- end switch end linkClicked ------------------------ on AskZIPCode get empty -- it variable initialization put "Enter the ZIP code:" into tPrompt -- the prompt repeat ask tPrompt with it as sheet if it = empty then return "Cancel" -- exit when the user cancels if the number of chars of it = 5 and it is an integer then exit repeat -- the input is a valid ZIP code > exit repeat put "That is not a valid ZIP code (5 digits):" into tPrompt -- we change the prompt end repeat end AskZIPCode ------------------------ on AskZIPCode2 get empty -- it variable initialization put "info" into tIcon -- the icon displayed put "Enter the ZIP code:" into tPrompt -- the prompt repeat do "ask" && tIcon && quote & tPrompt & quote && "with" && quote & it & quote && "as sheet" if it = empty then return "Cancel" -- exit when the user cancels if the number of chars of it = 5 and it is an integer then exit repeat -- the input is a valid ZIP code > exit repeat put "error" into tIcon -- we change the displayed icon in the dialog put "That is not a valid ZIP code (5 digits):" into tPrompt -- we change the prompt end repeat ----- answer info it as sheet end AskZIPCode2 @#4U cREVGeneralscriptChecksum@2Xƿc`$mɐ bookmarks revUniqueID 1113305374452 handlerList+rawKeyUp linkClicked AskZIPCode AskZIPCode2scriptSelectionchar 1424 to 1423 prevHandlerrawKeyUp tempScriptscript1

on rawKeyUp

end rawKeyUp

------------------------

on linkClicked pLink

switch pLink

case "Execute this code"

AskZIPCode -- 

break

case "Execute this code "

AskZIPCode2 -- 

end switch

end linkClicked

------------------------

on AskZIPCode

get empty -- it variable initialization

put "Enter the ZIP code:" into tPrompt -- the prompt

repeat

ask tPrompt with it as sheet

if it = empty then return "Cancel" -- exit when the user cancels

if the number of chars of it = 5 and it is an integer then exit repeat

-- the input is a valid ZIP code > exit repeat

put "That is not a valid ZIP code (5 digits):" into tPrompt

-- we change the prompt

end repeat

end AskZIPCode

------------------------

on AskZIPCode2

get empty -- it variable initialization

put "info" into tIcon -- the icon displayed

put "Enter the ZIP code:" into tPrompt -- the prompt

repeat

do "ask" && tIcon && quote & tPrompt & quote && "with" && quote & it & quote && "as sheet"

if it = empty then return "Cancel" -- exit when the user cancels

if the number of chars of it = 5 and it is an integer then exit repeat

-- the input is a valid ZIP code > exit repeat

put "error" into tIcon -- we change the displayed icon in the dialog

put "That is not a valid ZIP code (5 digits):" into tPrompt

-- we change the prompt

end repeat

-----

answer info it as sheet

end AskZIPCode2

 #How-To stack #015 by Eric Chatonet " 4/13/05 Initial release @ @ 45/27/05 Modified for Tutorial Picker compatibility @ @, @ 3This stack shows how to manage ask dialogs. Enjoy! 2 The Rev "built-in" Ask dialog is a simple stack you can see in the Application Browser (menu Tools) if you have checked the Revolution Ui Elements in Lists option in the View menu. ] ] b |    iAsk dialog is a substack of the Home stack, the License.rev file in the Rev main folder on your desktop.    $ 0 ;- RThis means that you can carefully edit the scripts of this stack for learning :-) Q But...   6First, play with the code builder in the Action pane! 5 ~The correct code is created and colorized on the fly. So, you can easily understand it by switching or changing the settings.  About the prompt @1600   0The prompt may count as many lines as you wish. wIf Answer dialogs support HTML text formatting, Ask dialogs do not: the prompt will be always displayed in plain text.  About the default answer @1600   lThe default answer must be a single line. If more lines are specified, only the last one will be displayed. dWe can regret that Rev does not select the text of the default answer when displaying the dialog... c  About the icons @1600   You can specify the icon which will be displayed on the left side of the dialog box with the first parameter: info, warning or error (without quotes). If you don't specify an icon, the standard Rev icon is displayed. n n r t {  T With Mac OS X, you can customize the displayed icons by addressing 2 global variables: gRevAppIcon and gRevAppSmallIcon (see the docs for more details). W W b g w!  About the "As Sheet" option @1600   This Mac OS X option has no effect on a previous Mac OS, Unix, or Windows system where the dialog is always displayed as a modal dialog box. # # glossary/Mac_OS.xml1 7 glossary/Unix.xml9 = glossary/Windows.xmlB V% glossary/modal_dialog_box.xml{ LWhen specifying as sheet, current title settings are ignored with Mac OS X. glossary/modal_dialog_box.xml   3   About the "Title" option @1600   `Win and Linux users are in the habit of naming such dialogs but it is not the case with Mac OS. dSo, purists will test the platform and display different dialogs according to the current platform. wWhen the as sheet option is used, the titled option is ignored on a Mac OS X system but will appear on another system.    & ,J U------------------------------------------------------------------------------------ @T @ Building prompts  JThe provided code builder produces only static dialogs (i.e. fixed text). xOften, you will need to build a dynamic prompt by concatenating quoted text, variables and/or properties. For instance: @ @ F1 A put "What is the nickname of" && fld "Name" & "?" into tPrompt @blue : $ ask tPrompt with "Jimmy" as sheet @blue  @brown  @blue @blue -Here the prompt depends on a field contents. _If this field contains "Jones", the displayed prompt will be "What is the nickname of Jones?". vNevertheless, you can use the provided code builder to prepare a dialog and then add any valid container to the code. +When building a prompt, rules are simple : 2 Quote always any text (including objects names) @1600 0 n Concatenate different containers by using "&" or "&&" (the last one adds a space while the first does not). @1600 g h eNote that it is always more readable to use a variable (named here tPrompt) when building your code. d U------------------------------------------------------------------------------------ @T Managing the user response  [An ask dialog is automatically dismissed when the user clicks on any button in the dialog. 8The input is placed by the engine into the it variable. + + - iIf the user clicks on the Cancel button, the it variable is always empty disregarding the current input. - - /9 OSo, you have only to get the contents of the it variable and act consequently: - - /  ask "What's your name?"  @blue  % if it = empty then return "Cancel"  @brown  @brown  @blue  / -- or if it = empty then exit  @hh"" DarkOrchid4 @hh"" DarkOrchid4 @hh"" DarkOrchid4 @hh"" DarkOrchid4 ' -- or if it = empty then exit to top  @hh"" DarkOrchid4 @hh"" DarkOrchid4 @hh"" DarkOrchid4 ( put it into tName -- a local variable @hh"" DarkOrchid4 @blue  @hh"" DarkOrchid4 -- etc.  @hh"" DarkOrchid4 @ U------------------------------------------------------------------------------------ @T 2Requesting an input that matches what is expected 1  0That is a very important point for reliability! @Red/  Advanced users will prefer to build their own ask dialogs (or include them in a card) in order to get a correct user input (by allowing the user to type only numbers or anything else :-)  ?WIth the built-in Rev dialog, you can't filter the user input. > jSo you have to test the user input and display again the dialog if it does not match what it is expected. i  7Imagine that you want to get a ZIP code with 5 digits: 6 @ SSolution 1 (without specifying an icon displayed in the dialog; then more simple): @ @ H @ * get empty -- it variable initialization  @  @hh""  B put "Enter the ZIP code:" into tPrompt -- prompt initialization  @blue @ # @hh"" DarkOrchid4) @hh""3  ----- @ @hh"" repeat  @brown ! ask tPrompt with it as sheet @brown @blue  @brown  @blue E if it = empty then return "Cancel" -- exit when the user cancels  @brown @  @brown @ @blue @  @hh"" DarkOrchid4' K if the number of chars of it = 5 and it is an integer then exit repeat  @  @  ( @: @? @D 3 -- the input is a valid ZIP code > exit repeat @ @hh"". @ put "That is not a valid ZIP code (5 digits):" into tPrompt  @blue @ 7 6 -- we change the prompt and go to the next repeat  @hh""1 end repeat  @  ----- @ @hh"" 5 put it into fld "ZIP Code" -- or whatever you need  @blue  @hh"" @hh"" Execute this code  @hh"" XSolution 2 (specifying an icon displayed in the dialog; requires using the do command): @ @ A @K @M @hh"" * get empty -- it variable initialization @blue  @hh"" DarkOrchid4  / put "info" into tIcon -- icon initialization  @blue  @hh"" DarkOrchid4 @hh""  B put "Enter the ZIP code:" into tPrompt -- prompt initialization  @blue # @hh"" DarkOrchid4) @hh""3  ----- @hh"" DarkOrchid4 repeat  @brown _ do "ask" && tIcon && quote & tPrompt & quote && "with" && quote & it & quote && "as sheet" @blue X E if it = empty then return "Cancel" -- exit when the user cancels  @brown  @brown @blue  @hh"" DarkOrchid4' K if the number of chars of it = 5 and it is an integer then exit repeat  @brown  @red  ( @brown: @blue? @brownD 3 -- the input is a valid ZIP code > exit repeat @brown @hh"" DarkOrchid4. I put "error" into tIcon -- we change the displayed icon in the dialog @brown @blue  @hh"" DarkOrchid4- @ put "That is not a valid ZIP code (5 digits):" into tPrompt  @blue 7 6 -- we change the prompt and go to the next repeat  @hh"" DarkOrchid4 @hh"" end repeat  @brown  ----- @hh"" DarkOrchid4 5 put it into fld "ZIP Code" -- or whatever you need  @blue  @hh"" Execute this code  Compare both formulations! 7In both cases, you start initializing local variables. vThen you use a repeat loop with a condition inside to exit the loop when the user cancels or when its input is valid. MAnd before the next repeat, you change the prompt text (the displayed icon). ZThe contents of the it variable is changed by the engine which fills it automatically :-) @hh"" DarkOrchid4 U------------------------------------------------------------------------------------ @T Digging into the docs   Ask command @1600    It keyword @1600    & operator @1600     if control structure @1600     return control structure @1600     exit control structure @1600    < gRevAppIcon and gRevAppSmallIcon keywords (Mac OS X only) @1600     " ( `g5=PrintEpAon mouseUp revPrintField the name of field "Info" end mouseUp %R cREVGeneralscriptChecksum4p0G! bookmarks revUniqueID 1113391824819 handlerListmouseUpscriptSelection char 53 to 52 prevHandlermouseUp tempScriptscript

on mouseUp

revPrintField the name of field "Info"

end mouseUp