[jawsscripts] Re: Unexpected DlgSelectItemInList error

  • From: "Donald Marang" <donald.marang@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Fri, 28 Aug 2009 15:31:37 -0400

Hi Logan,

I agree with Sean that line breaks may be a problem.  That is quite a list! 
I don't think the number of items while in memory is the problem here, 
however.  I have gone to web sites with tons of links and the links list 
JAWS dialog has no problems.  I suspect by the error message that there are 
more characters in a single statement than JAWS can handle!

First, I would assign portions of this list to several constants or 
variables.  Then they can be concatenated into a single variable or in the 
command.

I also noticed that you did not see anything being done with the return 
value.  That function returns the index of the selected item to be used to 
take some action.

Consider the following example:

Const
    DIALOG_TITLE = "Select Action To Perform: ",
    P1 = "Item 1|Item 2|Item 3",
    P2 = "Item 4|Item 5",
    P3 = "Item Item 6"
; not sure how many of these portions can be strung together?

Script ShowCommands ()
Var
    String sCommands,
    Int iChoice

Let sCommands = P1 + "|" + P2 + "|" + P3
Let iChoice = DlgSelectItemInList (sCommands, DIALOG_TITLE,1,1)
; 3rd parameter tells it to sort alphabetically
; iChoice will be 0 if nothing was selected (user cancelled or pressed 
Escape)
; perform desired actions based on iChoice ...
; take a look at StringSegment and other segments functions (each Item above 
is a segment)
EndScript

I am considering doing something similar.  I would like to read a small text 
file containing frequently used phone contacts and add them to the currently 
selected item.  I display these in a dialog with this function to make a 
free call or send a text message with Google Voice.

Does anyone know the limits of JAWS for the lengths of statements, 
variables, and constants?

Don Marang


----- Original Message ----- 
From: "Logan McMullen" <loganmcmullen@xxxxxxxxxxxxxxx>
To: "Jaws Scripting List" <jawsscripts@xxxxxxxxxxxxx>
Sent: Friday, August 28, 2009 1:38 PM
Subject: [jawsscripts] Unexpected DlgSelectItemInList error


> Hi,
>
> I'm creating a long list of items using the DlgSelectItemInList function.
> When I type in list items one by one as a test the script compiles but 
> when
> I copy and paste the long list of items I want I get an error when 
> compiling
> that states "Unexpected word DlgSelectItemInList".
>
> Is there some potential issue with copying a list from an external 
> word/text
> file and then pasting it into the script manager?
>
> the pasted list is copied below for your interest & comments:
>
> DlgSelectItemInList ("New document|Open
> document|Print|Save|Close|Tab|Undo|Repeat|Open font dialog box|Open find
> dialog box|Insert  hyperlink|Copy|Cut|Paste|Bold|Italics|Underline|Align
> left|Align center|Align right|Justify|Select
> all|Subscript|Superscript.|Hide/reveal  the ribbon|Opens print 
> preview|Open
> saved document|Shrink selected font|Grow selected font|Insert  Page
> break|Track  Changes|Insert footnote|Insert Endnote|Mark entry|Mark
> citation|View macros|Spelling and Grammar|Thesaurus|Select all text from
> current cursor position to the beginning of the document|Select all text
> from current cursor position to the end of the document|Office 
> button|Home
> tab|Insert tab|Page Layout tab|References tab|Mailings tab|Review tab|View
> tab|New document|Open a previously  saved document|Save document|Save As
> document|Save as word document|Save as word template|Save as Word 97-2003
> document|Find add-ins for other file formats|Other formats|Print
> document|Print|Quick Print|Print Preview|Properties|Inspect
> document|Encrypt document|Add a digital signature|Mark as Final|Run a
> compatability checker|Send as e-mail|Send as Internet  fax|Blog|Document
> management server|Create document workspace|Close document|Word 
> options|Exit
> Word|Paste|Cut|Copy|Format Painter|Show Office Clipboard task 
> pane|Font|Font
> Size|Bold|Italics|Underline|Strikethrough|Subscript|Superscript|Clear
> formatting|Highlight text|Font color|Change case|Grow font|Shrink
> font|Opens font dialog box|Starts bullet list|Starts numbered list|Starts
> multilevel list|Decrease indent|Increase indent|Align left|Align
> center|Align right|Align justify|Open line spacing list|Add space before
> paragraph|Add space after paragraph|Shading|Borders|Sort  order|Show/hides
> formatting symbols|Show paragraph dialog box|Show more headings|Open 
> change
> styles list|Opens styles list|Open editing list|Open find dialog 
> box|Replace
> selected text|Select text or objects in the document|Insert Cover
> page|Insert Blank page|Insert Page break|Insert Table|Insert Picture|Clip
> Insert art|Insert Shapes|Insert SmartArt|Insert Chart|Insert
> Hyperlink|Insert Bookmark|Insert Cross-reference|Insert Header|Insert
> Footer|Insert Page  number|Insert Text box|Quick parts|Insert Word
> Art|Insert Signature line|Insert Date and Time|Insert Object|Insert
> Equation|Insert Symbol|Themes|Theme colors|Theme  fonts|Theme
> Effects|Margins|Orientation|Size|Columns|Breaks|Line
> Numbers|Hyphenation|Page setup|Watermark|Page color|Page  border|Indent
> Left|Indent right|Spacing before|Spacing after|Paragraph dialog box|Object
> position|Bring to front|Send to back|Text 
> wrapping|Align|Group|Rotate|Table
> of Contents|Add text|Update table|Footnote|Endnote|Next footnote|Show
> notes|Footnote dialog  box|Insert a citation|Manage sources|Bibliography
> style|Bibliography|Caption|Table of figures dialog|Update table|Cross-
> reference|Mark entry|Insert index|Update index|Mark citation|Insert Table 
> of
> Authorities|Update Table of Authorities|Create  envelopes|Create
> labels|Start mail merge|Select recipients|Edit recipient list|Highlight
> merge fields|Address block|Greeting line|Insert  merge field|Rules|Match
> fields|Update labels|Preview results|First record|Previous record|Go to
> record|Next record|Last record|Find  recipient|Check for errors|Finish and
> merge|Spelling and Grammar|Research|Thesaurus|Translate| Translation
> Screentip|Set  Language|Word Count|Insert comment|Delete comment|Previous
> comment|Next comment| Track changes| Balloons|Display for  review|Show
> Markup|Reviewing pane| Accept and move to next|Reject and move to
> next|Previous change|Next change|Compare|Show  source documents|Protect
> document|Print layout|Fulll screen reading|Web Layout|Outline view|Draft
> view|View ruler|View  gridlines|Document map|Thumbnails|Zoom|100%|One
> page|Two pages|Page width|New window|Arrange all|Split|View side-by-
> side|Synchronous scrolling|Reset window position|Switch window|View 
> macros",
> "test List: ", 1, 1)
>
> I used a test list code of:
> DlgSelectItemInList ("Item1|Item2|Item3", "Select Action To Perform: 
> ",1,1)
> and the script compiled; however when I then replaced the list items with 
> my
> wanted list above I get the unexpected word error.
>
>
>
> Thoughts and suggestions please?
>
> Regards,
>
> Logan.
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus 
> signature
> database 4333 (20090813) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
> __________
> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>
> View the list's information and change your settings at
> http://www.freelists.org/list/jawsscripts
> 

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: