Posts: 1,769
Threads: 410
Joined: Feb 2003
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.
Posts: 12,061
Threads: 140
Joined: Dec 2002
Toolbar
Trigger
!ca"- Mozilla Firefox" "MozillaUIWindowClass"
Function
Function27
Trigger
!ca"- Mozilla Firefox" "MozillaUIWindowClass" /FIREFOX
Both run on my computer.
More functions too.
Function
Function53
Trigger
!ca"- Mozilla Firefox" "MozillaUIWindowClass" "" "" "" 0x4 /FIREFOX
Posts: 1,769
Threads: 410
Joined: Feb 2003
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"
;/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
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
Posts: 12,061
Threads: 140
Joined: Dec 2002
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
Posts: 1,769
Threads: 410
Joined: Feb 2003
it's the "save link as.." context menu item.
Posts: 12,061
Threads: 140
Joined: Dec 2002
In firefox 3.0.5 it is "Save As".
How with notepad?
!ca"$(.*Notepad|Open)" "Notepad"
!ca"Untitled - Notepad" "Notepad" /NOTEPAD
Posts: 1,769
Threads: 410
Joined: Feb 2003
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"
;/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
Posts: 12,061
Threads: 140
Joined: Dec 2002
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"
Posts: 1,769
Threads: 410
Joined: Feb 2003
BOOOOOM!!
putting "!ca"" "#32770" "&Save" "Button"" on the toolbar did it!
thanks!
Posts: 12,061
Threads: 140
Joined: Dec 2002
This may be useful, for example in filter function.
Function
IsWindowFileOpenSaveDialog
;/
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