rsiebler wrote:
> 
> I don't understand this.  What does multiple files have to do with
> it?  



If I select multiple filenames in my File Explorer, a list of 
filenames will be passed to Powerpro, one filename at a time. I've 
written my context script to collect all of the filenames first, then 
ask the user a dialogbox question once.



> 
> I tried this and PowerPro is no longer freezing, but now somehow
> parts of the script aren't executed and PPro has the script file
> locked.
> 
> Script if (contextlast)
> DO( ?"C:\Program FIles\PowerPro\PowerPro.exe", [EMAIL PROTECTED]
> (?"#++_file_++?#")# )
> 
> if(activewindow("Total Co*")) do
> local extract_path
> extract_path = InputCancel("Extraction Path: ")
> win.message(extract_path)
> window.show("Total Co*") ; this shows up
> Keys {to Total Co*}%{F9} ; * these lines don't execute
> win.message(extract_path); this shows up
> Wait.Until(activewindow("Unpack*")) ; *
> Keys {to Unpa*}{end}&(extract_path)\{enter} ; *
> endif



I cannot test your script with Total Commander since I don't use it, 
but I did a pseudo test with Explorer and it worked using your 
method. But if I opened 2 windows with the same name, it would 
fail ... explained below

Some differences in the way I script versus yours:

1. I generally use WIN.Show() and rarely use window.show(). I 
strongly suspect that this combined with using WIN.Message is the 
problem because the z-order is getting screwed with when using 
WIN.Message(). window.show() and WIN.Show() can retreave different 
windows in a z-order.

2. Use MESSAGEBOX("ok",extract_path) instead of WIN.Message
(extract_path). WIN.Message() can affect the z-order since it doesn't 
get its own focus.

3. I sometimes have to place a WAIT.For(...) following WIN.Show() or 
WIN.SetFocus(hFocus)

4. The only time I've seen a failure sending a Keys {to appname} 
(excluding Windows timing or Windows focus issues) was when the 
keyboard driver wasn't tracking the up and down of Alt, Ctrl, and Win 
keys properly. I had to update the keyboard driver on these computers.

5. I sometimes have to place a WAIT.For(...) following KEYS

6. I always use WAIT.For() or EVENTS and I never use Wait.Until(). 
Wait.Until() has limitations that I cannot tolerate, but I haven't 
tested Wait.Until() in a long time to see if Bruce removed these 
limitations. (Looking at help, they are still there.)

7. This is. I think, the best recommendation: Now that we have 
WIN.GetFocus and WIN.SetFocus(han), use these as much as possible 
when switching focus away from and back to a window. I have found 
these to be extremely reliable. I use WIN.GetFocus() and WIN.SetFocus
(han) now even when going to a PowerPro Menu, eg. for Snippets.



Try this instead (second best option):

Script if (contextlast)
DO( ?"PathTo\PowerPro.exe", [EMAIL PROTECTED](?"#++_file_++?#")# )

if(activewindow("Total Co*")) do
local extract_path = InputCancel("Extraction Path: ")
MESSAGEBOX("ok",extract_path)
WIN.Show("Total Co*")
Wait.For(20000, activewindow("Total Co*"))
Keys {to Total Co*}%{F9}
MESSAGEBOX("ok",extract_path)
Wait.For(5000, activewindow("Unpack*"))
IF(NOT activewindow("Unpack*"))
QUIT
Keys {to Unpa*}{end}&(extract_path)\{enter}
endif


OR try (I think this is best):


if(activewindow("Total Co*")) do
LOCAL hFocus=WIN.GetFocus
local extract_path = InputCancel("Extraction Path: ")
MESSAGEBOX("ok",extract_path)
WIN.SetFocus(hFocus)
Wait.For(20000, activewindow("Total Co*"))
Keys {to Total Co*}%{F9}
MESSAGEBOX("ok",extract_path)
Wait.For(20000, activewindow("Unpack*"))
IF(NOT activewindow("Unpack*"))
QUIT
Keys {to Unpa*}{end}&(extract_path)\{enter}
endif


This is my best shot at your issue, good luck.


Ted





Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to