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
 About
 Did you know...
 DYK: Some Browser Functionalities
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

gopikrish2000

34 Posts

Posted - 11/04/2013 :  02:04:12  Show Profile
1. If you have large number of tabs then you need to scroll right/left to select one particular tab , Below script will provide a popup will show all tabs available , upon clicking on a item will move you to appropriate Tab .


local gestureStartTabId = acGetControlID(nil, gex, gey)
acSendKeys("{DELAY 100}^9{DELAY 100}")
local rightMostTabId = acGetControlID(nil, gex, gey)
acSendKeys("^1{DELAY 100}")

ary = {}
controlIdAry = {}
maxTabsSupport = 25

function tabProcessor(maxIdUptoTraverse) 
local currentTabId = "0"
local i = 0
while i<maxTabsSupport do
    currentTabId = acGetControlID(nil, gex, gey)  
    if currentTabId == "0" then
       break
    end 
    ary[i] = acGetWindowTitle(nil, gex, gey)
    controlIdAry[i] = currentTabId
	i =  i+1
    if currentTabId == maxIdUptoTraverse then 
		break
	else
        acSendKeys("^{TAB}{DELAY 100}")
    end
end
return i
end

index = tabProcessor(rightMostTabId)

local res = ""
for val=0,index do
  if ary[val] then
   local modified = string.sub(ary[val], 0, 35)
   modified = string.gsub(modified, ",", " ")
   res = res..modified..","
  end
end

res = res.."Close this Popup"

function popupMenu(id)
if (id) <= index then
local controlId = controlIdAry[id-1]
acSendKeys("^1{DELAY 100}")
local m=0
 tabProcessor(controlId)
end
end

local abc = acCreatePopupMenu(gex,gey, res, ",","popupMenu")


2. Creating a Popup of Favourite Site , upon clicking will open in new tab

function popupMenu(id)
-- add in the map aganist the Items you provide in acCreatePopupMenu
local map = {
      [1] = "http://www.google.com/" , [2] = "http://www.gmail.com/"
    }
local url = map[id]
	
if url then
acSendKeys("^t{DELAY 100}%d{DELAY 50}"..url.."{DELAY 50}~")
end	
end

local abc = acCreatePopupMenu(gex,gey, "Google,gmail,Close this Popup", ",","popupMenu")



3. Duplicate the current tab

local previousCopy = acGetClipboardText()
acSendKeys("%d{DELAY 100}^x{DELAY 50}^t{DELAY 100}%d{DELAY 50}^v{DELAY 50}~")
acSetClipboardText(previousCopy)


4. Open Selected Text in a new Tab

local previousCopy = acGetClipboardText()
acSendKeys("^c{DELAY 50}^%t{DELAY 100}%d{DELAY 50}^v{DELAY 50}~")
acSetClipboardText(previousCopy)


5. Close Right Tab of current Tab

acSendKeys("^{TAB}{DELAY 30}^w{DELAY 30}^+{TAB}")


6. Close Other Tabs depending on mouse Start position (ie start the gesture which has almost same x-coordinate as the tab , y can be anywhere )

acMouseClick(gsx, 0, 0, 1, 1) 
acSendKeys("{DELAY 50}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}~")  
-- change number of downs depending on browser, where close Other tabs item is there in popup


7. Close Tabs to the right depending on mouse Start position (ie start the gesture which has almost same x-coordinate as the tab , y can be anywhere )

acMouseClick(gsx, 0, 0, 1, 1) 
acSendKeys("{DELAY 50}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}~")  
-- change number of downs depending on browser, where close right tabs item is there in popup


8. Close Tabs to right and Close other Tabs (works only in firefox ) what it does it do %d to select url bar and then do two shift Tabs ( if current tab not having flash content) or three shift Tabs ( if current tab is having flash content) then it focuses the tab . Then simulate right click with Shift F10 , and choose required menu item by Down then enter .

Actually if current tab is has flash content then one flash icon will come beside urlbar thats the reason for the extra Tab .
If current tab has flash content ( flash block icon beside url bar)

acSendKeys("%d{DELAY 50}+{TAB}+{TAB}+{TAB}{DELAY 50}+{F10}{DELAY 20}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}~")


If current tab doesn't has flash content

acSendKeys("%d{DELAY 50}+{TAB}+{TAB}{DELAY 50}+{F10}{DELAY 20}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}~")


9. Close Other Tabs other than current Tab without depending on mouse Start position . Below Script is having some issues , it can even Crash your S+ , use below at your own risk .

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/09/2013 12:01:01
  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