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
 Need Some Help - Browser Tabs Functions
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

gopikrish2000

34 Posts

Posted - 11/01/2013 :  10:06:05  Show Profile
Firstly thanks for providing such a good software which hardly takes any memory. I am very new to Strokesplus. The material , forums are very useful to setup most of my needs . But as a Firegestures (FF) user i want more control over tabs. Please answer are there possible to do with the StrokesPlus??

1. Close all tabs to the right/ Move tab forward ( all browsers not having a shortcut for assigning to strokesplus . [ Need something like current tab position and number of tabs there . So i can close it programatically one by one using Ctrl+W ] which i can do in Firegestures. ]

2. I want a popup some thing like below which will have list of words , upon clicking on each should do some specific user defined action [ with out creating those many gestures can wrap multiple gestures to show in a single popup ...] . Just Gestures is giving popup when same gesture has multiple items assigned to it.


3. The rocker gestures are not properly working ie. Upon pressing Right and continuously clicking left not working [ if left clicked only once its working ] . Also is it possible to have a reverse rocker gesture ( pressing Left and continuously clicking right ...) .

4. Also is there support for more browser features like show cookies,clear history .... which mi8 not be having shortcuts for some.

5. One Usability issue , upon deactivating a action ( uncheck Action Active) the name color should be changed to gray because as a new user its very difficult for me to check what all actions are active or not without checking all the actions.





Edited by - gopikrish2000 on 11/01/2013 11:12:23

Rob

USA
2615 Posts

Posted - 11/01/2013 :  18:06:00  Show Profile  Visit Rob's Homepage
1. Unfortunately, S+ cannot access data maintained inside another application. An Add-On like FireGestures is running within the scope of FireFox and thus can query and manage controls and other browser behavior. Without some wrapper with which to interact, S+ cannot get that low-level. As with other browser integration requests, the only realistic solution is to find one or more add-ons which provide some way to bind the desired action, via menu or (preferably) key combination.

2. S+ doesn't offer a popup menu, the closest option would be message boxes, but that's no replacement of a menu. This request has come up before and is something I'll try to work on.

3. The rocker-style support was a quick addition designed to somewhat accommodate the functionality without changing how S+ functions at a low-level. See here for some additional details. Yes, you can have a left down first and separate action for right-down first (details); however, you must reset the action (let go of the stroke button) to fire the action again. The mouse wheel was the only exception I made to this logic because the very nature of a wheel is to perform a continuous action. So, you can have rocker actions, but not ones which continually navigate by pressing the opposing button; you'd have to roll your fingers, releasing both then rolling again. The reason for this is because the left button can be a modifier to a gesture, so pressing it simply signals a modifier event to S+ in choosing the right action. Allowing an action to fire upon release (which is what your request would require) changes the functionality of S+. I personally have many gestures which use the left button as a modifier and having the release of the left button fire an action would break them. In the end, this is simply something for which there's a no win scenario without complicating the mouse hook significantly; so it will not be added anytime soon, if nothing else.

4. Same answer as number one. You may certainly be able to create a Lua script which sends the correct key/menu combinations to get to the appropriate functionality within the browser, but S+ being a program outside of the browser, it cannot access code and functionality internal to the browser. Again, add-ons would be the closest way to streamline it.

5. There is certainly room for improvement in how the S+ UI communicates with the user. The honest answer is that many fine UI tweaks are certainly nice to have, but in the end, I don't make much in the way of donations (maybe USD $50 in the past 9 months), so the personal time I do have to spend on S+ is very focused on core functionality, not the bells and whistles. If S+ weren't written in pure native WinAPI, graying out a tree item would be a simple property change; but it's not, it's a complicated painting routine which isn't impossible to do, just a big pain in the ass which to me is better spent implementing fixes or core functionality. I know that sounds like a lame excuse, but it just comes down to time and money...like everything else in life!
Go to Top of Page

gopikrish2000

34 Posts

Posted - 11/02/2013 :  14:51:31  Show Profile
Thanks for the reply ,

1. For the above point 2 , I used InputBox with comma seperated values with comma as delimiter . Its working as expected but I need the expanded dropdown all the time (as shown in the below image ) but only unexpanded dropdown i'm getting , i need to click on down button or ( alt + down ) to open the list every time . I tried to focus that window , tab it then do alt +tab but to no use . Am i doing some thing wrong ??. Is there any alternative to what i'm doing. See below

local userInput = acInputBox("UniqueTitle", "Some Message", "CB,CricInfo,gmail,GA,torrents,Android,PromoWiki,PromoUI", ",")
local hwndTarget = acFindWindowByTitleRegex("UniqueTitle")
acActivateWindow(hwndTarget, 0, 0, 0)
acSendKeys("{DELAY 1000}{TAB}{DELAY 100}%{DOWN}"); -- for focusing input box n doing alt +down
if userInput == "CB" then
-- dosomething end



2. I want to store some data and retrieve it even after S+ is reopened (like a persistent storage with state level info) . How should i do that?. I saw some methods about windowsRegistry and i don't think we should change windows registry for this thing . Any Help ? I'm trying to store last 15 copied data n then display like above popup to use when required on a gesture , is there any already script available for it . If not please suggest a way to do that .
Go to Top of Page

Rob

USA
2615 Posts

Posted - 11/02/2013 :  15:27:34  Show Profile  Visit Rob's Homepage
1. The problem is that Lua execution suspends while the input box is displayed, as it has to in order to know what selection was made. You could certainly get creative with Lua multi-threading (coroutine.create/status/yield/resume) and spawn a thread which fires the activate/sendkeys to the input box window. I'm going to work on adding a function to handle the creation of a popup menu (or something very similar).

2. I would recommend writing the data out to a .lua file which you can execute from Global Lua . See this post for snippets which can write out files, and this post for how to execute a .lua file in the Lua engine context.

Note that there are 2 completely separate Lua engine contexts, this is to allow running a script while there's already a script running. When Global Lua is loaded, it is executed in each context, but when you run an action, there's currently no intrinsic way (e.g. exposed to Lua) to know in which context the current script is running. Unless you have a long running action (like waiting for the acInputBox or actions using acDelay()) or are firing actions very quickly, you'll always be running in the primary context. I mention this because it could result in unexpected behavior if, for example, you've loaded your external .lua file into each context, but then alter state data in context 1, then later have concurrent actions, causing context 2 to be used, which still has the original state data, not the new data which exists in context 1. I would recommend if you alter state data to write out the data to your external file (within the same action that's altering the data to ensure the correct state data is saved), then call acReloadConfig() to ensure both contexts have the same state data. Make sense?

Stay tuned for acCreatePopupMenu functionality...
Go to Top of Page

Rob

USA
2615 Posts

Posted - 11/02/2013 :  18:50:28  Show Profile  Visit Rob's Homepage
Added acCreatePopupMenu in version 2.7.5.

acCreatePopupMenu(x, y, items, delim, function)

This function lets you display a custom popup menu via a delimited (specified in delim parameter) list of menu items (items parameter); "-" will create a menu separator. You define a function under Global Lua which will be called by S+ after a menu item is selected. The function must only accept a single parameter, which will always be a number.

Menu separators are skipped in terms of getting assigned an ID. Meaning, in the following example, the only potential values for id passed into popupMenu are 1, 2, 3, or 4.

Action script:
acCreatePopupMenu(gsx, gsy, "New Tab,Close Tab,-,Show ID,-,Close Menu", ",", "popupMenu")


Global Lua:
function popupMenu(id)
	if id == 1 then
		acSendKeys("^t")
	elseif id == 2 then
		acSendKeys("^w")
	elseif id == 3 then
		acDelay(200) 
		acMessageBox("id: "..id)
	else
		--Do nothing, for the Close Menu item
	end
end

Note that you can make as many separate Global Lua functions as you'd like to support many different menus, assuming they all have different names. All you have to do is specify the proper function name in your action's call to acCreatePopupMenu.
Go to Top of Page

gopikrish2000

34 Posts

Posted - 11/03/2013 :  06:09:15  Show Profile
Thank you very much for the Popup thing, very very helpful . One small thing once the popup comes if i'm not able to dismiss it without clicking on one of the items ( is there any time out kind of thing, whether it can use cancelDelay ) , i tweeked a bit added an empty element upon clicking which does nothing but cancels popup.

Please notify this change in the forms , many people doing lot of tweeks (like based on length , position x,y ) for same gesture to do lot many things , I think this is even better way to work regardless of screen size etc.

2. For "Close Other Tabs" functionality i implemented ( but if there are more than 1 tab with title of started tab then those tabs wont be closed . In Other Scenarios it works fine , tested in chrome but Some times its closing the browser also trying to close applications below don't know why? Kept this gesture for only browser )

local gestureStartTabTitle = acGetWindowTitle(nil, gex, gey)
acSendKeys("^{TAB}")
local currentTabTitle = ""
while true do
    currentTabTitle = acGetWindowTitle(nil, gex, gey)  
    if currentTabTitle == gestureStartTabTitle then 
       acSendKeys("{DELAY 50}^{TAB}")
           nextTabTitle = acGetWindowTitle(nil, gex, gey)
           if(nextTabTitle == currentTabTitle) then
            break
           else 
            currentTabTitle = nextTabTitle
           end
    else 
       acSendKeys("^w{DELAY 100}^{TAB}")
    end
end


3. For the recent 15 copies data list to track , should i be putting a timer for acGetClipboardText() and check for change or should track only those copied using copy gesture and change that ?? Also i'm planning it so store in .txt file and using functions io.write,read , i don't exactly understood the need of lua file instead of simple text file.

I'm a fan of firegestures but those admins hardly looked into people's requests. S+ is very good in this regard .

Edited by - gopikrish2000 on 11/03/2013 07:49:12
Go to Top of Page

gopikrish2000

34 Posts

Posted - 11/03/2013 :  12:13:18  Show Profile
I tried to solve it with the acGetControlID for window which is unique for each tab as checked , But i think there is some issue with acGetControlID(nil, gex, gey) method .
In Chrome , every tab is having unique controlId . So to "close other tabs" close all tabs which are not having initial tabs (gestureStartTabId) . Go from Start ( first tab ^1 ) till end (^9) close each one other than the gestureStartTabId ( ie if gestureStartTabId comes just skip it go to next tab ^{TAB} ) . If it is end (rightMostTabId) close tab and break loop.
Problems ::
1. But when only start (gestureStartTabId) tab is there then acGetControlID value is coming as rightMostTabId Instead it should come as gestureStartTabId . Any Idea Why ?? .Because of that its going to ELSEIF and even closing browser going to Infinite loop killing below apps underway .
2. Some times acGetControlID returning zero even when i gave proper delay why ??

Please run this i have kept logs as well .Also see the attachments . I hope i'm clear .



local gestureStartTabId = acGetControlID(nil, gex, gey)
acSendKeys("{DELAY 500}^9{DELAY 500}")
local rightMostTabId = acGetControlID(nil, gex, gey)
acSendKeys("^1{DELAY 100}")
local currentTabId = "0"
local check = "false"
acMessageBox("START -- currentTab -"..currentTabId.." ;;; gestureTab- "..gestureStartTabId.." ;;; rightMostTabId- "..rightMostTabId)

if gestureStartTabId == "0" or rightMostTabId == "0" then
return
else
--do nothing
end 

while true do
    currentTabId = acGetControlID(nil, gex, gey)  
    if currentTabId == "0" then
       break
    end 
    if currentTabId == gestureStartTabId then  
       if check == "false" then 
         acMessageBox("IF -- currentTab -"..currentTabId.." ;;; gestureTab- "..gestureStartTabId.." ;;; rightMostTabId- "..rightMostTabId)
	 acSendKeys("^{TAB}{DELAY 200}")
         check = "true"
       else 
         break
       end
    elseif currentTabId == rightMostTabId then 
	acMessageBox("ELSEIF -- currentTab -"..currentTabId.." ;;; gestureTab- "..gestureStartTabId.." ;;; rightMostTabId- "..rightMostTabId)
        acSendKeys("^w{DELAY 1000}")
	break
    else
	acMessageBox("ELSE -- currentTab -"..currentTabId.." ;;; gestureTab- "..gestureStartTabId.." ;;; rightMostTabId- "..rightMostTabId)
        acSendKeys("^w{DELAY 1000}")
    end
end



Edited by - gopikrish2000 on 11/03/2013 13:34:27
Go to Top of Page

Rob

USA
2615 Posts

Posted - 11/03/2013 :  14:31:13  Show Profile  Visit Rob's Homepage
I think your best bet is to either use an existing extension (e.g. Keyboard Shortcuts to Close Other/Right Tabs or possibly write your own extension. Anything you try to hack together via S+ scripts will never work as well as an extension which has direct access to the Chrome internal data. Plus, Chrome is constantly being updated and a small change in how they render tabs could cause your script to break.

I try to help out as best I can, but I simply don't have the time to debug and create scripts for each person out there; if I got paid to enhance and support S+ all day, I would love it! But that's not reality, I have a family and a full time job that will always come first.

For the clipboard, I honestly don't recommend using S+ to try and manage/maintain clipboard entries. The reason being that's a bit out of the scope of S+ and if you created a timer/loop, you'd be using one of the Lua engines constantly. Again, you're better off using an existing utility such as Ditto which I personally use and have for years. You can certainly tweak the shortcut keys to help integrate with gestures to make it more seamless, but S+ was not written to truly integrate with the clipboard and like the Chrome tab issue, anything you hack together in S+ will never be as powerful/flexible/efficient as a program which is designed specifically for a task.

I've tried to make S+ as extendable and flexible as I can, but in the end it's meant to be used for mouse gestures. While you can get really creative with the scripting engine, sometimes it's better to diversify and take advantage of other extensions/utilities which focus on specific functionality and let S+ interact with them, but they still do the work.

For what it's worth, the DELAY in SendKeys is not really meant to be used for pauses, you should use acDelay() instead. The DELAY in SendKeys is really meant to control the pauses between each keystroke; yes you can kind of leverage that to add delays, but acDelay is a better choice. I didn't write the SendKeys code, so I can't really speak to the internals of it, but let's say there are certainly many opportunities in the code and I would keep it simple when using acSendKeys, just for sending keystrokes.

Regarding the menu remaining open until clicked, that's something I'll look into later. I think it has to do with the S+ window not being foreground. But I intentionally didn't want it to become foreground for other reasons. I'll see what I can come up with; for now just make an extra "Cancel" menu item.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 11/03/2013 :  14:37:32  Show Profile  Visit Rob's Homepage
Actually, you can bring S+ to the foreground and post a NULL message to make the menu work as expected (goes away if you click somewhere else:
local swnd = acFindWindow("STROKESPLUS",nil)
acActivateWindow(swnd)
acDelay(100)
acPostMessage(swnd, 0x0000, 0, 0) 
acDelay(100)
acCreatePopupMenu(gsx, gsy, "Item 1,Item 2,-,Item 3,-,Close Menu", ",", "popupMenu")
You may need to play with the delays, but it works fine for me.

Edit: Now I remember the reason I didn't bring S+ to the foreground, because then S+ will receive your keystrokes unless you restore focus back. I'm working on an updates script.

Visit this thread instead for details and updates to acCreatePopupMenu (including updated code to make the menu go away if you click elsewhere): http://www.strokesplus.com/forum/topic/793/added-accreatepopupmenu

This page is getting a little hard to follow
Go to Top of Page

gopikrish2000

34 Posts

Posted - 11/04/2013 :  01:40:21  Show Profile
Actually thing is , i'm using Firegestures(FG) in FF which has all these close tabs etc (which i'm very much used to) but obviously it cann't do increase volume etc which S+ does . As of now i disabled S+ in FF because it cannot have both gesture engines at same time. S+ is able to do most of the things apart from Tab moving , closing etc , so i thought i will give it a try and uninstall Firegestures . May be i need to uninstall FG and install some other addons which does these i guess.

For popup , as mentioned in the link is working fine when clicking outside ,its closing.

Edited by - gopikrish2000 on 11/04/2013 04:36:42
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