Hi,
I would like to automate the conversion process of e-books with"calibre"-
To do this, I have to open a certain link ("click to open") in the calibre window
but this link-position is always located at different places in according to which
book is converted - to open the link with a "x y pos (mouse) click" is impossible (or is it ?)
The general question is "how to open a link in an open window"
greets
Max
Help to open a link in calibre program window
-
- Posts: 87
- Joined: 25 Jun 2017, 02:18
- Delta Pythagorean
- Posts: 628
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
- Contact:
Re: Help to open a link in calibre program window
You can always use ControlClick
[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat
-
- Posts: 87
- Joined: 25 Jun 2017, 02:18
Re: Help to open a link in calibre program window
hi
Thx for the hint -
ok - that's a idea to use "controlClick"
i try simply
Controlclick ,click to open,calibre,,,
or
Controlclick ,ahk_class Qt5QWindowIcon, calibre,,,
but nothing happend
what are the correct parameters ?
if i add a correct position x1225 y606 for a marked book ControlClick works:
ControlClick ,x1225 y606, calibre,,,, NA
the link will be open !
but if I mark now an other book, the position of the "click to open" - link is at an other position ??
thats the prob !
Max
Thx for the hint -
ok - that's a idea to use "controlClick"
i try simply
Controlclick ,click to open,calibre,,,
or
Controlclick ,ahk_class Qt5QWindowIcon, calibre,,,
but nothing happend
what are the correct parameters ?
if i add a correct position x1225 y606 for a marked book ControlClick works:
ControlClick ,x1225 y606, calibre,,,, NA
the link will be open !
but if I mark now an other book, the position of the "click to open" - link is at an other position ??
thats the prob !
Max
-
- Posts: 87
- Joined: 25 Jun 2017, 02:18
Re: Help to open a link in calibre program window
Hi DeltaDelta Pythagorean wrote:You can always use ControlClick
Could you pls help me in the use of "ControlClick" to solve my prob ?
Thx
Max
- Delta Pythagorean
- Posts: 628
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
- Contact:
Re: Help to open a link in calibre program window
ControlClick works off of the following parameters:
Control is the ClassNN that displays.
Run an AutoHotkey Script and right click the tray icon and then click window spy. Wait for it to run, open the program that has what you want, then hover over the item you want to click.
It should display the ClassNN.
Next, the WinTitle, this will allow you to click on the control in the window you want. WinText is unneeded in this problem and so is WhichButton, ClickCount, Options, ExcludeTitle, and ExcludeText.
I hope this helps.
Code: Select all
ControlClick [, Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText]
Run an AutoHotkey Script and right click the tray icon and then click window spy. Wait for it to run, open the program that has what you want, then hover over the item you want to click.
It should display the ClassNN.
Next, the WinTitle, this will allow you to click on the control in the window you want. WinText is unneeded in this problem and so is WhichButton, ClickCount, Options, ExcludeTitle, and ExcludeText.
I hope this helps.
[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat
-
- Posts: 87
- Joined: 25 Jun 2017, 02:18
Re: Help to open a link in calibre program window
Hi DeltaDelta Pythagorean wrote:ControlClick works off of the following parameters:Control is the ClassNN that displays.Code: Select all
ControlClick [, Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText]
Run an AutoHotkey Script and right click the tray icon and then click window spy. Wait for it to run, open the program that has what you want, then hover over the item you want to click.
It should display the ClassNN.
thx again - I have used "window spy" and hover over the item "Click to open" but I do not get usable results:
in "Control under Mouse Position" window spy generates "ClassNN: Text calibre - || Calibre-Bibliothek ||"
that is the same Information as in "Window Title" - so I get no specified access to the desired link "click to open"
Is there another way to access the link?
see pick for explantion
greets
Max
- Delta Pythagorean
- Posts: 628
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
- Contact:
Re: Help to open a link in calibre program window
Are you able to highlight the text, "Click to Open"?
[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat
-
- Posts: 87
- Joined: 25 Jun 2017, 02:18
Re: Help to open a link in calibre program window
yes - when i hover via the text (link) "Click to open" the text color changes from "blue" to "red"Delta Pythagorean wrote:Are you able to highlight the text, "Click to Open"?
Window Spy:
Control Under Mouse Positin\ClassNN\Text: no changes
Control Under Mouse Positin\ClassNN\Color: changes
Re: Help to open a link in calibre program window
You could send ^f then the name of the book to find it.
Then you could right-click on the colored highlight of the matching book.
Then you could send six {down}s a {right} and an {enter} to kick off the conversion.
(Your keypresses may differ, depending on what version of Calibre you are using.
Then you could right-click on the colored highlight of the matching book.
Then you could send six {down}s a {right} and an {enter} to kick off the conversion.
(Your keypresses may differ, depending on what version of Calibre you are using.
- Delta Pythagorean
- Posts: 628
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
- Contact:
Re: Help to open a link in calibre program window
No, I mean select the text as if it was able to be edited like a message here.
[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat
-
- Posts: 87
- Joined: 25 Jun 2017, 02:18
Re: Help to open a link in calibre program window
Hi Delta,Delta Pythagorean wrote:No, I mean select the text as if it was able to be edited like a message here.
sorry - small misunderstanding
yes I can highlight the line "click to open"
see:
best regards
Max
- Delta Pythagorean
- Posts: 628
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
- Contact:
Re: Help to open a link in calibre program window
Is it always on the left or right side of the Gui? Because that might help immensely.
[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat
-
- Posts: 87
- Joined: 25 Jun 2017, 02:18
Re: Help to open a link in calibre program window
"click to open" is always on the right side of the GuiDelta Pythagorean wrote:Is it always on the left or right side of the Gui? Because that might help immensely.
but the position differs
- Delta Pythagorean
- Posts: 628
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
- Contact:
Re: Help to open a link in calibre program window
Differs how?
Show a screenshot of the full Gui. I'm not getting much information.
Also, is it in the same position "X"-wise?
Show a screenshot of the full Gui. I'm not getting much information.
Also, is it in the same position "X"-wise?
[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat
-
- Posts: 87
- Joined: 25 Jun 2017, 02:18
Re: Help to open a link in calibre program window
okDelta Pythagorean wrote:Differs how?
Show a screenshot of the full Gui. I'm not getting much information.
Also, is it in the same position "X"-wise?
here is a picture showing 2 screenshots of the Gui's of 2 diffrent books:
as you see: the position of "click to open" is located at different positions
how can i hit "click to open" and open it ?
Max
- Delta Pythagorean
- Posts: 628
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
- Contact:
Re: Help to open a link in calibre program window
I'm sorry but I can't think of any possible way.
Sorry.
Sorry.
[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat
-
- Posts: 87
- Joined: 25 Jun 2017, 02:18
Re: Help to open a link in calibre program window
Hi Delta
OK
Thank you for your help - I thought so
greets
Max
OK
Thank you for your help - I thought so
greets
Max
-
- Posts: 16
- Joined: 17 Jul 2017, 16:55
Re: Help to open a link in calibre program window
You could use the mouse cursor to find the link:
Point the mouse to a spot on the screen just above "Jobs 0". Then in a loop, slowly, with small SLEEP delays, move the mouse up 3 pixels at a time until the cursor becomes the pointing hand. At that time it must be pointing at Click to open, so then you send a click.
Point the mouse to a spot on the screen just above "Jobs 0". Then in a loop, slowly, with small SLEEP delays, move the mouse up 3 pixels at a time until the cursor becomes the pointing hand. At that time it must be pointing at Click to open, so then you send a click.
-
- Posts: 87
- Joined: 25 Jun 2017, 02:18
Re: Help to open a link in calibre program window
Ok i understand your "radar "- solution - very niceKeypressGuy wrote:You could use the mouse cursor to find the link:
Point the mouse to a spot on the screen just above "Jobs 0". Then in a loop, slowly, with small SLEEP delays, move the mouse up 3 pixels at a time until the cursor becomes the pointing hand. At that time it must be pointing at Click to open, so then you send a click.
but when "the cursor becomes the pointing hand (== meeting the link 'click to open')" what is the AHK command in my script to detect this and send a "click" ?
Max
-
- Posts: 16
- Joined: 17 Jul 2017, 16:55
Re: Help to open a link in calibre program window
The variable A_Cursor will (probably) be "Arrow" until it becomes a hand, at which point it becomes "Unknown".
The BREAK will break out of the loop. Then past the end of the loop, you issue a click command with no parameters because, presumably, the mouse is already pointing right at the link.
With this kind of mouse cursor loop it is easy to overshoot the mark. Just keep increasing the SLEEP until the motion is slow enough that it always triggers the logic.
For protection, you could also use MouseGetPos to check the actual mouse cursor position and kill the process if the mouse pointer gets near the top of the window (A low OutputVarY value).
Code: Select all
loop
{
MouseMove, 0, -3, R
Sleep 60
if (A_Cursor <> "Arrow")
break
}
click
With this kind of mouse cursor loop it is easy to overshoot the mark. Just keep increasing the SLEEP until the motion is slow enough that it always triggers the logic.
For protection, you could also use MouseGetPos to check the actual mouse cursor position and kill the process if the mouse pointer gets near the top of the window (A low OutputVarY value).
Who is online
Users browsing this forum: yzqiang and 113 guests