Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Title + url + TimeDate + FixedText + Selected text of chrome
#5
need  to add  opt clip 1
Code:
Copy      Help
spe -2;;autodelay for code to run smoother if this code is in a function
opt clip 1;; this sets options to not restore clipboard after using getsel
int w=win("- Google Chrome" "Chrome_WidgetWin_1")
act w
key Ac          ;; Alt+C
0.3;;needs some delay here for tabcopy to finish
str tabcopystextboth.getclip
str td.timeformat("{hh:mm tt} - {ddMMMyy}")
str contents.getsel
str result=F"{tabcopystextboth}[]{td}[](MY CHROME COPIED CONTENTS)[][]{contents}"
out result;; just here to show output in qm not needed
result.setclip


i don't know if your toolbar is attached to chrome window or not. below is code for attached toolbar and functions run off that toolbar

Toolbar Toolbar_Attached_To_Chrome
Trigger !a"- Google Chrome" "Chrome_WidgetWin_1"     Help - how to add the trigger to the macro
Code:
Copy      Help
Use QM :int+ c_tbwindow=GetToolbarOwner(TriggerWindow); mac "GetInfo_Acc"
Use TabCopy :int+ c_tbwindow=GetToolbarOwner(TriggerWindow); mac "GetInfo_tabcopy"

toolbar functions
Function GetInfo_Acc
Code:
Copy      Help
opt clip 1
spe -2
int+ c_tbwindow
int w1=c_tbwindow
Acc a.Find(w1 "DOCUMENT" "" "" 0x2000 3)
str title=a.Name
str url=a.Value
str td.timeformat("{hh:mm tt} - {ddMMMyy}")
str contents.getsel
str result=F"{title}[]{url}[]{td}[](MY CHROME COPIED CONTENTS)[][]{contents}"
out result;; just here to show output in qm not needed
result.setclip
act _hwndqm;;just here to show qm window again not needed

Function GetInfo_tabcopy
Code:
Copy      Help
spe -2
opt clip 1
int+ c_tbwindow
int w1=c_tbwindow
str s.all; s.setclip
key Ac          ;; Alt+C
0.3;;needs some delay here for tabcopy to finish
str tabcopystextboth.getclip
str td.timeformat("{hh:mm tt} - {ddMMMyy}")
str contents.getsel
str result=F"{tabcopystextboth}[]{td}[](MY CHROME COPIED CONTENTS)[][]{contents}"
out result;; just here to show output in qm not needed
result.setclip
act _hwndqm;;just here to show qm window again not needed

Also make sure Enable chrome acc when it starts is checked in qm options
qm window menu tools/options
   


Messages In This Thread
RE: Title + url + TimeDate + FixedText + Selected text of chrome - by Kevin - 10-03-2020, 02:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)