Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Window triggering two QM items
#1
I have a window that triggers a toolbar and a function but only the toolbar executes when the trigger happens. When I disable the toolbar, the function runs. Is there a way to make them both trigger off the same window? Note:the function only runs when it's a firefox window but the toolbar should run on that and any other.
An old blog on QM coding and automation.

The Macro Hook
#2
Toolbar
Trigger !ca"- Mozilla Firefox" "MozillaUIWindowClass"     Help - how to add the trigger to the macro

Function Function27
Trigger !ca"- Mozilla Firefox" "MozillaUIWindowClass" /FIREFOX     Help - how to add the trigger to the macro
Code:
Copy      Help
mes 1

Both run on my computer.

More functions too.
Function Function53
Trigger !ca"- Mozilla Firefox" "MozillaUIWindowClass" "" "" "" 0x4 /FIREFOX     Help - how to add the trigger to the macro
Code:
Copy      Help
MES m.x=1
mes 2 "" m
#3
here's my trigger. I think it may have something to do with the regex in the trigger. could that be?
if i take out the trigger for the toolbar it works fine

Toolbar
Trigger !ca"$(.*save to|Open)" "#32770"     Help - how to add the trigger to the macro
Code:
Copy      Help
;/mov -48 0 /siz 46 {0.05; GetWinXY TriggerWindow 0 0 0 _i; ret _i} /isiz 32 32 /set 1|4|128

Function Redirect_Name
Trigger !ca"Enter name of file to save to…" "#32770" /FIREFOX     Help - how to add the trigger to the macro
Code:
Copy      Help
int hwnd=val(_command)
spe 80
str a b c d
int z
0.15
;Retry


Acc aa=acc("File name:" "TEXT" win("Enter name of file to save to" "#32770" "firefox") "Edit" "" 0x1801 0x0 0x20000040)
err
,0.15
,_i+1
,if _i=10
,,end
,goto Retry
str aa_str=aa.Value

more code below
An old blog on QM coding and automation.

The Macro Hook
#4
Where is "Enter name of file to save to…" in firefox? I use firefox 3.0.5.
To test, I created similar triggers with notepad. Both run.

!ca"$(.*Notepad|Open)" "Notepad"
!ca"Untitled - Notepad" "Notepad" /NOTEPAD
#5
it's the "save link as.." context menu item.
An old blog on QM coding and automation.

The Macro Hook
#6
In firefox 3.0.5 it is "Save As".

How with notepad?

!ca"$(.*Notepad|Open)" "Notepad"
!ca"Untitled - Notepad" "Notepad" /NOTEPAD
#7
here's my new toolbar based on your code for Notepad. I'm looking for both to go off when the dialog goes off but the macro only to go off when FF creates the "Enter name of file to save to…" dialog (btw: i get that when i try to download an mp3 file from websites like this). so i modified your code to reproduce the behavior for notepad.
btw: still not getting both to work. toolbar in this senario won't appear.
Toolbar
Trigger !ca"$(Save As|Open)" "notepad"     Help - how to add the trigger to the macro
Code:
Copy      Help
;/mov -48 0 /siz 46 {0.05; GetWinXY TriggerWindow 0 0 0 _i; ret _i} /isiz 32 32 /set 1|4|128
Redun :out "toolbar"


here's my macro for notepad
Function Macro3
Trigger !ca"Open" "#32770" /NOTEPAD     Help - how to add the trigger to the macro
Code:
Copy      Help
out
out _s.time("%X")
An old blog on QM coding and automation.

The Macro Hook
#8
Here works in firefox and in notepad. I replaced

!ca"$(Save As|Open)" "notepad"
to
!ca"$(Save As|Open)" "#32770"

--------

Maybe FF sets "Enter name of file to save to…" later...


--------

This trigger can be used for Save As dialogs:
!ca"" "#32770" "&Save" "Button"
#9
BOOOOOM!!
putting "!ca"" "#32770" "&Save" "Button"" on the toolbar did it!

thanks!
An old blog on QM coding and automation.

The Macro Hook
#10
This may be useful, for example in filter function.

Function IsWindowFileOpenSaveDialog
Code:
Copy      Help
;/
function! hwnd

;Returns 1 if hwnd is handle of a file open or save dialog. Returns 0 if not.


if(!wintest(hwnd "" "#32770")) ret
if(!child("" "shelldll_defview" hwnd)) ret
if(!child(stc4 "" "Static" hwnd)) ret
if(!child(lst1 "" "ListBox" hwnd)) ret
if(!child(pshHelp "" "Button" hwnd)) ret
;Tested on win 2000, xp, vista, 7 beta. Not tested old style dialogs.
;On all OS these dialogs are different, also different are Open and Save As dialogs, etc, but always have these controls (most of them are hidden).

ret 1
err+ ret


Forum Jump:


Users browsing this thread: 2 Guest(s)