ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Transpose 2.3.2.3

<< < (7/19) > >>

MilesAhead:
Transpose 2.2.7.2 Added Hotkey Alt Click in supported browser windows.

Purpose: You are on a page that has a url in text that's not enabled as a link. Ordinarily you would select text, open new tab, paste, or use a tab extension to enable automating that action. With this Transpose update, select the text and Alt Click the mouse on a neutral spot. It's done for you. (The reason to click on a neutral spot is a Click is sent to the page to clear the text selection.)

This hotkey is only enabled while a supported browser window is active. It gets the exe path of the browser from the active window and runs it.  The selection is only added as a command line param.
Therefore it should be safe. If you select "del *.*" and do Alt Click the result would be(assuming firefox browser)  running this command "c:\program files\mozilla firefox\firefox.exe del *.*" which will just produce a 404 error.  Not delete files. :)

MilesAhead:
Transpose 2.2.7.3 Removed a couple of redundant text copy to clipboard keys. I think I've come up with a smooth AutoCopy selected text to clipboard.  Select text but hold left mouse button down until you press and release Shift.  If selected text is copied to clipboard you should hear a tone.

See the about dialog for current sets of hotkeys.

MilesAhead:
Transpose 2.3.0.0 IE Browser is no longer supported.  Also listed editors and browsers that support Control-t Transpose function in About Dialog.

MilesAhead:
Transpose 2.3.0.1 Now AutoCopy using Shift/Release while Left Mouse Button down no longer sends a Click to deselect the text.  AutoCopy sounds a tone to verify something was copied to clipboard. Deselecting the text is no longer needed as an indicator. Also it interfered with timing letting off the mouse button.  Now it's not so touchy.  Select text and keep mouse button down.  Press and release Shift key. You should hear the tone as text is now in clipboard.

If you want to clear the selection just click the mouse yourself.  The text will still be in the clipboard.

MilesAhead:
Transpose 2.3.0.3 Chromium browsers were using ahk_class Chrome_WidgetWin_0. I see now they have changed in the latest snapshots to ahk_class Chrome_WidgetWin_1. I have added that so that stuff like +LButton and ^LButton to open links in background and foreground respectively, works for the new snapshots. (For me, holding down both control and shift, then clicking, just to open a link in a foreground tab is way too awkward.)

Here's my latest source


--- ---;
; Transpose - copyright 2012 www.favessoft.com
;
; Utility to transpose 2 characters to the left of the caret
; in editors and/or browsers, for typo fix on the fly.
;
; I use this script as a kind of catch all for hotkeys
; that don't need ini file settings. See About Dialog
; for details
;
; Author: MilesAhead
;
; Use Visit Hotkey Page Tray Menu command to get latest version
; and view Windows Requirements.
;
; Use Donate Tray Menu command to support future releases
;
; FavesSoft Windows Utilities are free for you to use
; at your own risk.
;
; MilesAhead
;
#SingleInstance force
#NoEnv
#Warn UseUnsetLocal, Off
DetectHiddenWindows, On
SetTitleMatchMode,2
SendMode Input
SetWorkingDir %A_ScriptDir%
CoordMode,ToolTip,Screen
#Hotstring EndChars `t
Menu Tray,NoStandard
Menu Tray,Add,Donate,DoDonate
Menu Tray,Add,Visit Hotkey Page,DoVisit
Menu Tray,Add,About Transpose,DoAbout
Menu Tray,Add
Menu Tray,Add,Quit,DoQuit
Menu Tray,Default,About Transpose
if (A_IsCompiled)
{
  Menu Tray,Icon,%A_ScriptFullPath%,1
  Menu Tray, Icon, About Transpose, Transpose.exe,, 24
  Menu Tray, Icon, Visit Hotkey Page, Transpose.exe,2, 24
  Menu Tray, Icon, Donate, Transpose.exe,3, 24
  Menu Tray, Icon, Quit, Transpose.exe,4, 24
}
Menu Tray,Tip,Transpose

TMin := 0
TSec := 0
Selected := ""
KeyHHCmd := "KeyHH -AutoIt C:\Program Files\AutoIt3\WinAPIEx.chm::/html/libfunctions.htm"
GroupAdd,EditorGroup, ahk_class TFormEditPadLite  ;EditPadLite
GroupAdd,EditorGroup, ahk_class TFormEditPadLite7 ;EditPadLite7
GroupAdd,EditorGroup, ahk_class wxWindowClassNR   ;FBIde
GroupAdd,EditorGroup, ahk_class SciTEWindow       ;Scite
GroupAdd,EditorGroup, ahk_class MAINFBEDIT        ;FBEdit
GroupAdd,EditorGroup, ahk_class Notepad           ;Notepad
GroupAdd,EditorGroup, ahk_class TFormMain         ;TreePad
GroupAdd,EditorGroup, ahk_class Chrome_WidgetWin_0   ;Chromium Browser
GroupAdd,EditorGroup, ahk_class Chrome_WidgetWin_1   ;Chromium 20.x
GroupAdd,EditorGroup, ahk_class MozillaUIWindowClass ;Firefox Browser
GroupAdd,EditorGroup, ahk_class MozillaWindowClass   ;Firefox 4 Browser
GroupAdd,EditorGroup, ahk_class OperaWindowClass     ;Opera 11
GroupAdd,EditorGroup, BBCeditor ; BBCeditor

GroupAdd,BrowserGroup, ahk_class Chrome_WidgetWin_0   ;Chrome Browser
GroupAdd,BrowserGroup, ahk_class Chrome_WidgetWin_1   ;Chromium 20.x
GroupAdd,BrowserGroup, ahk_class MozillaUIWindowClass ;Firefox Browser
GroupAdd,BrowserGroup, ahk_class MozillaWindowClass   ;Firefox 4 Browser
GroupAdd,BrowserGroup, ahk_class OpWindow             ;Opera Browser
GroupAdd,BrowserGroup, ahk_class OperaWindowClass     ;Opera 11

GroupAdd, ChromeGroup, ahk_class Chrome_WidgetWin_0   ;Chrome Browser
GroupAdd, ChromeGroup, ahk_class Chrome_WidgetWin_1   ;Chromium 20.x

GroupAdd,ExplorerGroup, ahk_class CabinetWClass
GroupAdd,ExplorerGroup, ahk_class ExploreWClass

#IfWinActive ahk_Group EditorGroup
^t::
  ClipSaved := ClipboardAll ; save entire clipboard
  Clipboard= ; clear clipboard
  Send {Shift Down}{Left}{Shift Up} ; select char left of caret
  Send ^c ; copy char
  ClipWait,0 ;give copy time to complete
  ; the caret is positioned to insert
  ; the char from the clipboard. Editor
  ; must be in Insert Mode for it to work.
  ; The char is inserted, and caret positon restored.
  ;
  Send {Right}
  Send {BackSpace}
  Send {Left}
  Send {Raw}%Clipboard% ; avoid puntuaction being interpreted
  Send {Right}
  Clipboard := ClipSaved
  ClipSaved = ; free memory
Return

#IfWinActive ahk_group ChromeGroup
^LButton::
  Send, ^+{LButton}
Return

#IfWinActive ahk_group ChromeGroup
+LButton::
  Send, ^{LButton}
Return

#IfWinActive ahk_Group BrowserGroup
::qq::
  Clipboard =
  Send,^a
  Send,^c
  ClipWait,1
  Send,{Right}
  Process,Exist,selector.exe
  if ErrorLevel
    Send,^{NumPadDiv}
Return

!LButton::
  pPath := WinGetProcessPath("A")
  Clipboard =
  Send,^c
  ClipWait,1
  Selected = %Clipboard%
  Click
  if pPath && Selected
    Run, %pPath% %Selected%
Return

^F10::
  Clipboard =
  Send ^c
  ClipWait,1
  Click
  Sleep, 100
  Selected = %Clipboard%
  if Selected
    Run,http://www.thefreedictionary.com/%Selected%
Return

+F10::
  TMin := 0
  TSec := 0
  Clipboard =
  Send ^c
  ClipWait,2
  Selected = %Clipboard%
  gosub,ShowResults
Return

^F9::
  Clipboard =
  Send,^{LEFT}^+{RIGHT}
  Sleep,10
  Send,^c
  ClipWait,0
  Selected := Clipboard
  Send,{Right}
  Run,http://www.thefreedictionary.com/%Selected%
Return

; AutoCopy to clipboard in supported browsers
;
; Select text with mouse, holding left mouse
; button down. Press and release Shift, then release
; mouse button. If text copied to clipboard the
; selection will be cleared.
;
~Shift::
  if not GetKeyState("LButton")
    Return
  Clipboard =
  Send ^c
  ClipWait,1
  Selected = %Clipboard%
  if not Selected
    Return
  SoundPlay,*48
Return

#IfWinActive ahk_Group ExplorerGroup
MButton::
  MouseClick, left, , , 2
Return

+MButton::
  Progress, zh0 B fs12 CTBlue,Press a letter to open`nExplorer to that drive
  Input,keypress,L1
  Progress, OFF
  dr := keypress . ":\"
  StringUpper,dr,dr
  If FileExist(dr)
  {
    Run,Explorer.exe /e`,%keypress%:\
  }
  else
  {
    Progress, zh0 B fs12 CTRed,%dr% Drive Does Not Exist!
    Sleep,3000
    Progress, OFF
  }
Return

;Newsbin floating Groups List
;show posts on Group Middle Click
#IfWinActive ahk_class XTPDockingPaneMiniWnd
MButton::
  Send,^l
Return

;if UltraSearch 1.5 is minimized to Tray
;pressing Shift Backspace should open window
;
;requires UltraSearch 1.5 or later as previous
;versions do not have "single instance" behavior
#IfWinExist UltraSearch
  +BS::
  Run,C:\Utils\UltraSearch\UltraSearch.exe
Return


ShowResults:
    Loop, parse, Selected, `n, `r
    {
        StartPos := RegExMatch(A_LoopField,"[0-9]+:")
        if (!StartPos)
            continue
        StringMid,found,A_LoopField,StartPos,5
        if (found)
        {
            found = %found%
            StringLeft,nstr,found,InStr(found,":") - 1
            TMin := TMin + nstr
            ;StringMid,nstr,found,InStr(found,":") + 1,2
            StringRight,nstr,found,2
            TSec := TSec + nstr
            if (TSec // 60)
            {
                TMin := TMin + TSec // 60
                TSec := Mod(TSec,60)
            }
        }
    }
    TSec := (StrLen(TSec)=1) ? "0" TSec : TSec
    MsgBox, 4160, Transpose, Total Time:  %TMin%:%TSec%
Return

DoAbout:
  FileGetVersion,filever,Transpose.exe
  MyMsg =
  (
Transpose v %filever% Copyright (c) 2012 www.FavesSoft.com`n
Control-t Transposes the 2 characters left of the caret`n
Supports edit controls in Chrome, Firefox and Opera Browsers.
Supports EditPadLite, EditPadLite7, FBIde, FBEdit, Scite, Notepad,
and TreePadLite Editors`n
Chrome Browsers:`n`nControl-Click opens link in new foreground Tab`nShift-Click in new background Tab`n`nChrome. Firefox, and Opera Browsers:`n`nAlt Click opens Selected Text in new tab if valid URL`nShift/Release with left mouse key down to AutoCopy Text`nqq Tab in Edit Copies All text to Clipboard, triggers Selector`n`nControl F9 key looks up word left of caret on`nThe Free Dictionary   Control F10 key looks up selection`n`nShift F10 key to total AllMusic play times`n
Middle Mouse Click in Explorer to Double-Click`n
Shift Middle Click an empty spot in Explorer to open a Drive Letter`n`n
Note: IE Browser is not supported.
  )
  if WinExist("UltraSearch.exe")
    MyMsg := MyMsg . "Shift Backspace Displays UltraSearch 1.5 if running in Tray"
  MsgBox, 4160, About Transpose, %MyMsg%
Return

DoDonate:
  Run,"http://www.favessoft.com/donate.html"
Return

DoVisit:
  Run,"http://www.favessoft.com/hotkeys.html"
Return

DoQuit:
  ExitApp

--- Helper Functions ---

; Usage: WinGetProcessPath("A") to get program path for active window
; returns "" on error, program path on success
;
; e.g. chromium browser might return C:\Program Files\Chromium\chrome.exe
;
; adapted from WinGetProcessName by Lexikos
;
WinGetProcessPath(WinTitle="", WinText="", ExcludeTitle="", ExcludeText="")
{
  WinGet pid, PID, %WinTitle%, %WinText%, %ExcludeTitle%, %ExcludeText%
  if !hproc := DllCall("OpenProcess", "uint", 0x410, "int", false, "uint", pid)
      return
  VarSetCapacity(name, 520)
  static hmod := DllCall("LoadLibrary", "str", "psapi") ; Preload psapi.dll.
  DllCall("psapi\GetModuleFileNameEx", "ptr", hproc, "ptr", 0, "str", name, "uint", 260)
  DllCall("CloseHandle", "ptr", hproc)
  return name
}

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version