StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 can i create a specific gesture for a website ?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

giulia

1 Posts

Posted - 07/23/2018 :  01:28:53  Show Profile  Reply with Quote
Hi
i really love strokesplus
i create all my gesture for chrome and they works perfecly many of them using the forum
i'm almost a novice

i use in chrome the left & right gesture acSendKeys("{BROWSERBACK}") and acSendKeys("{BROWSERFORWARD}")

can i create a spefic gesture for a website (for example flickr) ?

can i use willcards like * ww.flir.com/photos/*

in flick , when you watching a gallery with many photos you can go back and forth with the left & right keyboard keys

can i create a spefic gesture for a website (for example flickr) ?

should i create a new app ?
can you help me please with the most easy solution and maybe a lua script?

thanks



Edited by - giulia on 07/23/2018 01:30:29

Rob

USA
2492 Posts

Posted - 07/23/2018 :  09:33:47  Show Profile  Visit Rob's Homepage  Reply with Quote
Try this:
if string.match(acGetWindowTitle(nil, gsx, gsy), ".*| Flickr.*Google Chrome$") ~= nil then
	acMessageBox("This is Flickr", "Match!")
	--Put your code here
end
I didn't spend a lot of time on it, but it seems to work for me.
Go to Top of Page

Rob

USA
2492 Posts

Posted - 07/23/2018 :  09:39:44  Show Profile  Visit Rob's Homepage  Reply with Quote
If you only want to use the URL, you'd have to do something like
acSendKeys("^l") --press ctrl+L to set the focus to the address bar
acDelay(25)
acSendKeys("^c") --send ctrl+C to copy the url
local url = acGetClipboardText() --get the url from the clipboard
--Check the URL here, could use the Lua string.match or string.find to test

But check the forums here as well because some people have certainly done some complicated things based on different web sites.
Go to Top of Page

Gaia

2 Posts

Posted - 07/23/2018 :  10:00:57  Show Profile  Reply with Quote
quote:
Originally posted by Rob

Try this:
if string.match(acGetWindowTitle(nil, gsx, gsy), ".*| Flickr.*Google Chrome$") ~= nil then
	acMessageBox("This is Flickr", "Match!")
	--Put your code here
end
I didn't spend a lot of time on it, but it seems to work for me.


Hi Rob
the script works very well!
just wondering if i should add a new app ( a second chrome app) or find 2 new gestures that can fit
because left and right , are not available
i have searched in the forum without luck
thank you so much Rob , really appreciate
Go to Top of Page

Rob

USA
2492 Posts

Posted - 07/23/2018 :  10:09:56  Show Profile  Visit Rob's Homepage  Reply with Quote
Sure, create a new app.

Owner Title Pattern: ^.* Flickr.*Google Chrome$
File Name: chrome.exe

That should cover it.

Edit: You might need to create an exclusion in the regular Chrome app so it doesn't match that one first, possibly.

Or in your action for left or right, you can do two different things, based on the window title, and only have one chrome app.
Go to Top of Page

Gaia

2 Posts

Posted - 07/23/2018 :  10:22:26  Show Profile  Reply with Quote
quote:
Originally posted by Rob

If you only want to use the URL, you'd have to do something like
acSendKeys("^l") --press ctrl+L to set the focus to the address bar
acDelay(25)
acSendKeys("^c") --send ctrl+C to copy the url
local url = acGetClipboardText() --get the url from the clipboard
--Check the URL here, could use the Lua string.match or string.find to test

But check the forums here as well because some people have certainly done some complicated things based on different web sites.


hi amazing code
it should be like this?
acSendKeys("^l") --press ctrl+L to set the focus to the address bar
acDelay(25)
acSendKeys("^c") --send ctrl+C to copy the url
local url = acGetClipboardText() --get the url from the clipboard
--Check the URL here, could use the Lua string.match or string.find to test
if string.match(acGetWindowTitle(nil, gsx, gsy), "local url") ~= nil then
	acMessageBox("This is Flickr", "Match!")
	--Put your code here
end
Go to Top of Page

Rob

USA
2492 Posts

Posted - 07/23/2018 :  10:25:08  Show Profile  Visit Rob's Homepage  Reply with Quote
You don't want to test against the window title:

if string.match(url, "PATTERN HERE") ~= nil then
acMessageBox("This is Flickr", "Match!")
--Put your code here
end

Check the Lua string patterns page here: http://lua-users.org/wiki/PatternsTutorial
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000