Subscribe to this thread
Home - General / All posts - User Interface Script - Dialog index out of range
firsttube


1,439 post(s)
#27-May-16 17:20

I had a script running but for some reason now it does not work. The Data Source dialog opens but then it just stalls there, nothing happens. When I remove the loop I get the index out of range error on "ctrlset("ListViewDataSources").Text = "Data connection name"" Can someone help?

'vbscript

set ui = application.userinterface

set comp = document.componentset("Drawing")

set proj = ui.Panes("Project")

set tree = proj.ControlSet("TreeViewComponents")

tree.Text = comp.Name

ui.InvokeCommand "ViewProjectReLink""pane: Project"

Do ' Nothing

Loop Until UI.ModalDialog.Caption = "Data Source"

set dlg = ui.modaldialog

set ctrlset = dlg.ControlSet

ctrlset("ListViewDataSources").Text = "Data connection name"

ctrlset("ButtonOK").Push()


"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013

firsttube


1,439 post(s)
#27-May-16 17:36

for some reason when I shut my computer down and start it back up then try running the script it works. Any ideas why this happens?


"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013

tjhb
10,094 post(s)
#27-May-16 19:51

Add a loop, before the existing one, to wait for ui.DisplaysModalDialog (there are lots of examples of this).

The reason it might work directly after reboot is just that timing happens to be a bit different (perhaps slower)--timing issues like this are subjectively random and any small difference can "fix" (i.e. mask) them.

firsttube


1,439 post(s)
#28-Jul-16 20:37

As reported in other posts, the only way I could get a particular UI script to work was to disable my LAN connection.


"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013

firsttube


1,439 post(s)
#07-Oct-16 18:01

Further to this, I was still having trouble so I checked what was running on my computer and noticed there was an Adobe Update ready to install. I closed this, and ran the script and it worked. Coincidence? I don't know, but I've now been able to run the script several times in a row successfully.


"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013

tjhb
10,094 post(s)
#08-Oct-16 03:40

It's hard not be imagine wildly how this could make sense.

One thing: maybe the Adobe updater (also) uses the Windows Scripting Host, and the Windows Scripting Host allows one thread to interrupt another.

Another thing: maybe the Adobe updater repeatedly polls window handles to check whether its target applications are currently active, and somehow this polling interferes with Manifold's window enumeration.

Or: mere coincidence, not specially relevant.

This is all weak speculation, I know.

Can you say what the Adobe updater is? Is it for e.g. Creative Suite (which?), or Acrobat/Adobe Reader?

Can you reproduce the issue, by re-enabling the Adobe updater, or just allowing it to launch before you use Manifold?

firsttube


1,439 post(s)
#11-Oct-16 15:51

The issue with my script in Manifold was that a dialog box would open (Data Source dialog), and the script had a loop to wait for a ModalDialog to open and then to check that the caption was "Data Source". The loop waiting for the caption to equal "Data Source" would run infinitely. I did some checks like open a messagebox with the caption, or add the caption to a comments component. The caption would always be null. It was almost as if Manifold was detecting a different dialog box that had no Caption (?).

The adobe updater was for Acrobat reader. However, I just tried the script again with the Adobe Reader Updater turned off and it suffered the same symptoms. I think I narrowed it down to the TeamViewer application running in the background. When I shut that down the script ran fine. I will continue testing to see if I can more definitively say what application is causing a problem.


"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013

tjhb
10,094 post(s)
#11-Oct-16 18:46

Is your TeamViewer account (if you use one) safe?

http://arstechnica.com/security/2016/06/teamviewer-says-theres-no-evidence-of-2fa-bypass-in-mass-account-hack/

firsttube


1,439 post(s)
#11-Oct-16 20:08

I have no reason to think it is not.


"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.