Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
autoload next page
#12
If possible, use trigger "window name changed".

Else use this function to run macros when Firefox page URL changes:
Function Firefox_address_triggers
Trigger !cv"* - Mozilla Firefox" "MozillaWindowClass" "" "" "" 0x2     Help - how to add the trigger to the macro
Code:
Copy      Help
;\
int w=TriggerWindow
Acc a
str s sPrev
rep
,0.5
,if(!IsWindow(w)) ret
,if !a.a
,,a.Find(w "DOCUMENT" "" "" 0x3000 1); err continue
,s=a.Value; err
,if(_hresult) a.a=0; continue
,if(s=sPrev) continue
,sub.UrlChanged w s sPrev
,sPrev=s


#sub UrlChanged
function w str&url str&previousUrl

;Edit this sub-function. Add/remove case for URLs you need.
;You can edit it while this function is running. Click Compile to apply changes.

out url
sel url 3
,case "https://m.facebook.com/*"
,mac "facebook macro" "" w url previousUrl
,;;the macro should begin: function [hwnd] [$url] [$previousUrl]
,
,;case ["url2","url3"]
,;mac "macro2"
,
,;...

;err+ out _error.description
This function itself has trigger "Firefox window created and is visible". It runs until the window closed.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)