This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
 All Forums
 Lua Scripts
 General Action Scripts
 Open link in new tab

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
mesersmith Posted - 10/24/2013 : 13:38:21
This is teh defaul code for this action, but it doesn't work.
I need when I right click on a link and drag down, I need to open a new tab with this link content.
Can I make some modification to make it work?
I use Chrome.

if acGetMouseCursorType() == "HAND" then
acMouseClick(gsx, gsy, 1, 1, 1)
else
acSendKeys("^t")
end

Thanks.
8   L A T E S T    R E P L I E S    (Newest First)
Strokeman Posted - 05/05/2015 : 12:10:28
quote:
Originally posted by SonGokussj4
And I'm not even speaking about the nervecracking functionality when on Youtube and the video is on focus. (did someone resolve that somehow? "when youtube site / unfocus / do the gesture...)


Try this thread .. has 2 solutions ( 2nd one seems easy, yet to check myself)
http://www.strokesplus.com/forum/topic/332/
Rob Posted - 04/30/2015 : 20:58:20
Hmm, I can't reproduce this on my system. Is there a possibility that S+ isn't recognizing the gesture? Or recognizing a different gesture which doesn't result in any visible action?

If you can give me a very specific web page and set of links for me to try to reproduce, I'll see if I can find anything. I went to Google and started a search, then used your exact script without error.

However, note that the "HAND" check is over the exact pixel where the gesture started..if you happen to be just outside the hyperlink border that Firefox assigns for the link, when S+ moves the mouse there, it won't be a hand cursor, thus will send CTRL+V resulting in nothing happening.
SonGokussj4 Posted - 04/29/2015 : 03:08:08
Hello, I've got a problem. I'm using Firefox with Strokes+
In the past I've been using Firefox plugin - Fire Gestures and there were two strokes I really loved.
Up (on link) - open in a new tab on top
Down (on link) - open in a new tab on background
(Up or Down (when multiple links were selected (even with some text)) - open all links on top/background)

But I really LOVE strokes+ so I tried to recreate this condition + classic Copy / Paste. But it's not functioning 100%.

"My" code: (As shown in previous post and slightly modified)
[ Stroke - Down ]

acConsumePhysicalInput(1) --prevent hand mouse movements from moving the mouse
acMouseMove(gsx, gsy) --move the cursor back to where the gesture began
acDelay(20) --pause briefly to allow the cursor to be drawn
if acGetMouseCursorType() == "HAND" then
acMouseClick(gsx, gsy, 1, 1, 1)
else
acSendKeys("^v")
end
acMouseMove(gex, gey) --move the mouse back to where the gesture ended
acConsumePhysicalInput(0) --allow input to behave as normal


The problem is that when I start the gesture on Link, and end upon another link, it does nothing.
Now and then it does nothing even when the stroke is good. I have to do it for the second time and then it works.
And I'm not even speaking about the nervecracking functionality when on Youtube and the video is on focus. (did someone resolve that somehow? "when youtube site / unfocus / do the gesture...)

I'm writing mainly if anyone has some kind of "better code" then this one for this operation of opening links.

Thank you very much and Rob - I LOVE your work and I'm recommending it from person to person. :-) And they love it too.
mesersmith Posted - 03/26/2015 : 14:21:10
I have this code:

-- this code does one of two things, if the mouse cursor
-- is a HAND, the link below the cursor is opened in a new
-- tab. If the mouse cursor is not a HAND, a new browser
-- tab is opened this action is executed by holding the
-- stroke button and clicking the left mouse button, either
-- over a link or anywhere over the browser for a new tab
--if acGetMouseCursorType() == "HAND" then
-- acMouseClick(gsx, gsy, 1, 1, 1)
--else
-- acSendKeys("^t")
--end


acConsumePhysicalInput(1) --prevent hand mouse movements from moving the mouse
acMouseMove(gsx, gsy) --move the cursor back to where the gesture began
acDelay(50) --pause briefly to allow the cursor to be drawn
if acGetMouseCursorType() == "HAND" then
acMouseClick(gsx, gsy, 1, 1, 1)
else
acSendKeys("^t")
end
acMouseMove(gex, gey) --move the mouse back to where the gesture ended
acConsumePhysicalInput(0) --allow input to behave as normal


This code works like a charm in Internet Explore, Chrome and Modzilla, but doesn't work at all in Opera 28. Is there anybody who knows why is that?

I have several codes like this, with another function, wich doesn't work on Opera, but works great in any other browser.
mesersmith Posted - 10/24/2013 : 14:18:40
Wow, works great, almost similar to mouse gesture in Opera.
Rob Posted - 10/24/2013 : 14:12:33
To replicate that functionality using a gesture which draws away from the link, you'd have to do something like this:
acConsumePhysicalInput(1) --prevent hand mouse movements from moving the mouse
acMouseMove(gsx, gsy) --move the cursor back to where the gesture began
acDelay(50) --pause briefly to allow the cursor to be drawn
if acGetMouseCursorType() == "HAND" then
	acMouseClick(gsx, gsy, 1, 1, 1) 
else
	acSendKeys("^t")
end
acMouseMove(gex, gey)  --move the mouse back to where the gesture ended
acConsumePhysicalInput(0) --allow input to behave as normal

Chrome doesn't open tabs in the foreground by default, so you'd have to use an extension such as:

Tab Activate
mesersmith Posted - 10/24/2013 : 13:54:31
Yes, I understand the meaning of the code, and it works if I drag the mouse a little, to be stil a hand.
Than, I use your code and works great. But how can I write a code wich will do the same thing, but it must open that new tab.
Now it works, but the new tab is in backgroud. I have to click on it to open it.
It can be done?
Rob Posted - 10/24/2013 : 13:44:49
The original code was meant to either open the link in a new window if the cursor is a HAND, or open a new tab if not. That code checks to see if the mouse cursor is a HAND pointer at the time the action is triggered. If you've dragged the mouse down and away from the link, it will no longer have a HAND pointer cursor. You can simply call:

acMouseClick(gsx, gsy, 1, 1, 1)

StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000