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

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

 All Forums
 General Discussion
 General Discussion
 Site Specific Gestures within Browser
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Strokeman

33 Posts

Posted - 06/28/2014 :  16:30:40  Show Profile
Ok, here is something interesting i thought of (i am sorry for my innovative mind...if millions already doing it.. possible.. lol)

Given the fact internet browsing is among top of list regarding amount of time spent by people on PC's/etc
&
given the fact that different people interact with different sets of same websites on day after day based on their work (Like some are social networking freaks stuck to FB, Twitter only, Some search freaks, some news website freaks, etc)...

Can we make site specific gestures on browsers (say FFox)
i.e. a gesture (for doing something specific on that website)


Ofc we all know that many websites allow KB shortcuts like Gmail, Youtube player controls (thats flash though(html5 is around too)problematic for S+?). Further almost any website navigation/actions can be done using stuff like autohotkeyhttp://www.autohotkey.com/board/topic/47052-basic-webpage-controls-with- -com-tutorial/

S+ selects adress bar (CTRL+L)
copies the weblink in address bar (CTRL+C)
matches domain with that in code (No idea how to do that)
if so then implements gesture, as per the website in browser tab


Now this way we can make a gesture do similar type of site navigation on different websites with same gestures
Say gesture swiping right on Youtube will play next video and the same will click next feature on some news website.

Can anyone help how to implement matching domain name in code? is there a "=" function of sorts in S+?
TIA





Edited by - Strokeman on 06/29/2014 10:01:41

Noesis

25 Posts

Posted - 06/29/2014 :  09:52:32  Show Profile
Yeah there is, remember S+ uses Lua for the code in the actions. From the Lua 5.1 reference manual (www.lua.org/manual/5.1/manual.html) you could probably use either of:

string.find(s, pattern [, init [, plain]])

Looks for the first match of pattern in the string s. If it finds a match, then find returns the indices of s where this occurrence starts and ends; otherwise, it returns nil. A third, optional numerical argument init specifies where to start the search; its default value is 1 and can be negative. A value of true as a fourth, optional argument plain turns off the pattern matching facilities, so the function does a plain "find substring" operation, with no characters in pattern being considered "magic". Note that if plain is given, then init must be given as well.

or

string.match(s, pattern [, init])

Looks for the first match of pattern in the string s. If it finds one, then match returns the captures from the pattern; otherwise it returns nil. If pattern specifies no captures, then the whole match is returned. A third, optional numerical argument init specifies where to start the search; its default value is 1 and can be negative.
Go to Top of Page

Strokeman

33 Posts

Posted - 06/30/2014 :  08:48:24  Show Profile
Thanks noesis for reply.
I haven't yet fiddled anything with lua script option (you meant global lua?)
or is it that the normal commands in S+ are themselves lua? (looks like this is the case)

Anyway can you gimme a example if possible
for say string.match(s, pattern [, init])
Say we are on link http://www.strokesplus.com/forum in address bar
and by making a gesture "N", we want to open a new topic i.e http://www.strokesplus.com/forum/post.asp?method=Topic&FORUM_ID=15
so search should confirm that address bar has http://www.strokesplus.com/forum
else say if its http://www.amazon.com , gesture "N" should mean new wish list i.e opening link http://www.amazon.com/gp/registry/wishlist/ (this link is incomplete though)


This way we can make gestures for most commonly done functions on Commonly used websites and since code will know what to do on what, same gestures can be used across all of them :)

Edited by - Strokeman on 06/30/2014 08:51:06
Go to Top of Page

Noesis

25 Posts

Posted - 07/02/2014 :  04:39:18  Show Profile
FYI Lua is used in both the global lua and the gesture command scripts. Global lua area just has a greater "global" scope.

With regard to the example it entirely depends on what you want to achieve, personally I'd use the string.find() since you can turn off the pattern matching, which complicates things since pattern matching uses regular expression syntax for the pattern to match/find for example a . means any character you'd need \. for a literal period but then you may actually need \\. to make the backslash a literal (as it's the lua escape char) for parsing the pattern string ? I'm not sure, hence I'd use string.find().

The following psuedo code should do what you want but bare in mind it will do it for any page in each domain including a new topic/wishlist page. (I'm also assuming you've already done the steps you mentioned above i.e. up to copying the text in the link to the clipboard & how to open the new page, and it's code residing in the gesture specific area btw)

local CurrentPage = acGetClipboardText()
if string.find(CurrentPage, "strokesplus.com", 1, true) ~= nil then
*open the strokesplus new topic page*
elseif string.find(CurrentPage, "amazon.com",1, true) ~= nil then
*open the amazon wishlist page*
endif

hopefully this is of some help.
Go to Top of Page

Strokeman

33 Posts

Posted - 07/05/2014 :  08:29:17  Show Profile
quote:
Originally posted by Noesis


... but bare in mind it will do it for any page in each domain including a new topic/wishlist page.

local CurrentPage = acGetClipboardText()
if string.find(CurrentPage, "strokesplus.com", 1, true) ~= nil then
*open the strokesplus new topic page*
else if string.find(CurrentPage, "amazon.com",1, true) ~= nil then
*open the amazon wishlist page*
endif

hopefully this is of some help.


thanks for help N
i think its "end" instead of "endif" in lua

I tried with following code.
acSendKeys("^l")
acSendKeys("^c")
local CurrentPage = acGetClipboardText()
if string.find(CurrentPage, "strokesplus.com", 1, true) ~= nil then
local s = 'http://www.strokesplus.com/forum/post.asp?method=Topic&FORUM_ID=15'
acShellExecute("open","rundll32.exe",
"url.dll,FileProtocolHandler "..s, nil, 1)
end
if string.find(CurrentPage, "amazon.com",1, true) ~= nil then
--open the amazon wishlist page
end


So overall it appears fine. I am thinking on more possibilities and better navigation within sites

But a tiny issue, say you have 10 tabs open, this code actually opens tab as 11th tab with new link.
Is there any way we can run the link on same tab itself?
or just as adjoining tab.( like usually done for search Google/Search engine option)

Thanks

Go to Top of Page

Noesis

25 Posts

Posted - 07/09/2014 :  09:41:06  Show Profile
Yeah you're right about the endif.

As far as getting the link to open in current tab goes, I imagine it depends on how the page is opened, and also the browser and the settings it's using. One method to try is instead of opening the page as you did in the example above using the acShellExecute function, you could try copying the site directly to the url bar in the open browser (either via clipboard or using sendkeys) which should replace the current string with the new then send an 'enter' keystroke which would make it think it was launched from the url bar instead... this may or may not work depending on how the browsers settings are configured. Otherwise I'm out of ideas.
Go to Top of Page

iyhk

8 Posts

Posted - 07/13/2014 :  22:59:34  Show Profile


http://postimg.org/image/nchajh9f9/

you can use the title name to use different gesture in different site.

Edited by - iyhk on 07/13/2014 23:03:02
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000