topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday October 26, 2020, 5:38 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Onesimus Prime [ switch to compact view ]

Pages: [1]
1
Post New Requests Here / "PazzPort Helper"
« on: May 17, 2010, 02:27 AM »


So I recently bought a little gadget called an iPazzPort (among other aliases) and am getting another as a present for someone.  Basically, this thing is a tiny wireless QWERTY keyboard and touchpad (picture here, review here).  I'm generally enjoying it; wouldn't want to do extensive typing on it at all, though.  But--I'm finding out just how spoiled I usually am in terms of navigation on a laptop.  This thing doesn't have a scroll region on the touchpad, and it's missing several important (to me) keys: Function keys, Win key, Tab, Shift, Home, End, PgUp, PgDown, Prnt Scrn, etc.  You can see the keyboard layout in the above picture.  Yep, no Alt+F4, no Alt+Tab, no Win+E, no Ctrl+Shift+End, etc. - all the shortcut keys that I normally use so often.

Especially since I'll be "gifting" one of these shortly, I'm trying to figure out a way to fill the void as far as navigation goes.  I've been messing around with a combination of the portable mouse gestures program StrokeIt and an AutoHotkey script.  My goal is to have something as simple, yet functional, as possible.  Here's what I was thinking so far, but if anyone has better ideas I don't mind scrapping this.  This has a lot of re-mapping to remember, which can just get confusing.  I'm a newbie at AHK and the below took me an embarrassing number of hours, so if someone else wants to start from scratch, I wouldn't mind that either...

#SingleInstance force

;Alt+F4
; missing: Function keys, Win key, Tab, Shift, Home, End, PgUp, PgDown, Prnt Scrn,


; `::Tab
Ctrl & Backspace::AltTabMenu
~t::RapidHotkey("{TAB}",3, 0.2)
~a::RapidHotkey("!^a", 3, 0.2)
~q::RapidHotkey("#zqdir{Enter}""!{F4}",2)
~e::RapidHotkey("#z""#r""#e",3, 0.2)
~Esc::RapidHotkey("SusScript""ReloadScript""exit", 3, 0.2, 1) ;Press Esc 5 times rapidly to exit this script

Ctrl & Esc::
send {LAlt down}
send {LWin down}
sleep 1500
send {LWin up}
send {LAlt up}
return

Alt & Esc::
send {Shift down}
sleep 3000
send {Shift up}
return

SusScript:
Suspend on
sleep 3000
Suspend off
return

ReloadScript:
Reload
MsgBox,0,,Reloaded
return

Exit:
ExitApp


; ------- HotKeyIt's "RapidHotkey" function --------

RapidHotkey(keystroke, times="", delay=0.15, IsLabel=0)
{
   Pattern := Morse(delay*1000)
   If (StrLen(Pattern) < 2 and Chr(Asc(times)) != "1")
      Return
   If (times = "" and InStr(keystroke, """"))
   {
      Loop, Parse, keystroke,""   
         If (StrLen(Pattern) = A_Index+1)
            continue := A_Index, times := StrLen(Pattern)
   }
   Else if (RegExMatch(times, "^\d+$") and InStr(keystroke, """"))
   {
      Loop, Parse, keystroke,""
         If (StrLen(Pattern) = A_Index+times-1)
            times := StrLen(Pattern), continue := A_Index
   }
   Else if InStr(times, """")
   {
      Loop, Parse, times,""
         If (StrLen(Pattern) = A_LoopField)
            continue := A_Index, times := A_LoopField
   }
   Else if (times = "")
      continue = 1, times = 1
   Else if (times = StrLen(Pattern))
      continue = 1
   If !continue
      Return
   Loop, Parse, keystroke,""
      If (continue = A_Index)
         keystr := A_LoopField
   Loop, Parse, IsLabel,""
      If (continue = A_Index)
         IsLabel := A_LoopField
   hotkey := RegExReplace(A_ThisHotkey, "[\*\~\$\#\+\!\^]")
   Loop % times
      backspace .= "{Backspace}"
   keywait = Ctrl|Alt|Shift|LWin|RWin
   Loop, Parse, keywait, |
      KeyWait, %A_LoopField%
   If ((!IsLabel or (IsLabel and IsLabel(keystr))) and InStr(A_ThisHotkey, "~") and !RegExMatch(A_ThisHotkey
   , "i)\^[^\!\d]|![^\d]|#|Control|Ctrl|LCtrl|RCtrl|Shift|RShift|LShift|RWin|LWin|Escape|BackSpace|F\d\d?|"
   . "Insert|Esc|Escape|BS|Delete|Home|End|PgDn|PgUp|Up|Down|Left|Right|ScrollLock|CapsLock|NumLock|AppsKey|"
   . "PrintScreen|CtrlDown|Pause|Break|Help|Sleep|Browser_Back|Browser_Forward|Browser_Refresh|Browser_Stop|"
   . "Browser_Search|Browser_Favorites|Browser_Home|Volume_Mute|Volume_Down|Volume_Up|MButton|RButton|LButton|"
   . "Media_Next|Media_Prev|Media_Stop|Media_Play_Pause|Launch_Mail|Launch_Media|Launch_App1|Launch_App2"))
      Send % backspace
   If (WinExist("AHK_class #32768") and hotkey = "RButton")
      WinClose, AHK_class #32768
   If !IsLabel
      Send % keystr
   else if IsLabel(keystr)
      Gosub, %keystr%
   Return
}   
Morse(timeout = 400) { ;by Laszo -> http://www.autohotkey.com/forum/viewtopic.php?t=16951 (Modified to return: KeyWait %key%, T%tout%)
   static lastkey
   tout := timeout/1000
   key := RegExReplace(A_ThisHotKey,"[\*\~\$\#\+\!\^]")
   Loop {
      t := A_TickCount
      KeyWait %key%, T%tout%
     Pattern .= A_TickCount-t > timeout
     If(ErrorLevel)
      Return Pattern
     KeyWait %key%,DT%tout%
      If (ErrorLevel)
         Return Pattern
   }
}

So far my "strategy" has been to use not-likely-used key combinations (e.g. Ctrl+Esc), or multiple key presses with the RapidHotkey function.  But there are only so many unused key combinations, and I don't know that they might do something horrible in some programs.  And RapidHotkey uses backspace to clear the triggering text entry, which of course causes something else entirely in an Explorer or Internet Explorer window.  Plus it's hard to remember, potentially unreliable if the iPazzPort/my fingers are finicky, etc.  One of the other things I was doing is to send "down" messages for certain unavailable modifier keys, sleep for a few seconds to give me time for key combinations, then send the "up" messages.  Again, there are probably better, more efficient, more easily remembered ways of doing that? 

Help!    :)

2
Finished Programs / ReplaceAbsolutePaths (RAP)
« on: March 15, 2010, 08:42 PM »
ReplaceAbsolutePaths (RAP) - a small app for the portable-software-lovers out there, to maybe make their lives just a little easier... 

From the (admittedly long) readme:
"I was testing a program for portability recently and discovered that, although it could be portable, the process required a fair amount of manual editing of text-based settings files, converting absolute paths to relative ones.  This is also the case in many program launchers such as Executor, SlickRun, or Launchy, as well as other software like MetaPath or QuickWayToFolders."
"Sometimes if a file is 'buried' in enough levels of folders and subfolders, it can get confusing how many '..\' to use."
"Basically, this program [RAP] has two general functions: calculating a relative path when given two absolute ones, and offering to replace any instances of an absolute path with the newly calculated relative one within a particular text-based settings file."

RAP should probably be considered still in beta...  The first attachment at the bottom of this post is version 0.8.9, complete with a Readme.  The second is an older 0.8.2 version, .exe only.  This program makes a .ini file in its own folder, hence it is also portable.

If you use the text-replace function,
1) Please first double-check what changes it will do to which file!
2) When doing its text-replace, RAP should make a backup of the original file with the added extension .rbak, so if something goes wrong, you can erase the changed one and rename the *.rbak file to its original filename (simply erase ".rbak").

Alright, hope this is helpful to y'all!

3
What I was kind of hoping for/envisioning was a portable, cross-browser (or at least IE-compatible) version of the CopyAllUrls extension for FireFox.  That extension, which is fairly flexible, can save the URLs and titles of open webpages across multiple tabs and even going back through a tab's history!  The user also defines the format for the output.

I downloaded the source for Skrommel's UrlHistory and tweaked it a bit as a first step toward this.  Right now, it uses the hard-coded shortcut keys Ctrl+Shift+C to copy the current IE tab's URL and title, Ctrl+Shift+V to paste all of these that have been copied (and empty the 'database' or whatever), Ctrl+Shift+E to empty the 'database' without pasting, and Ctrl+Shift+Q to quit.

Let me say that I don't really know AHK, so any and all alterations may be somewhat hack-ish, there's probably some now-unnecessary code, etc.  And yes, I found the thread with a similar request, but 1) I'm posting code  :), and 2) more importantly, I think my goals for this program and my implementation are slightly different...
;UrlCopy.ahk
;version 1.0.3
; changes: no longer puts URLs in tray menu
; grabs webpage address and name from current IE tab
;Skrommel @ 2006
;modified by Onesimus Prime


#SingleInstance,Force
#Persistent

applicationname=UrlCopy

changed=0
Gosub,READINI
Gosub,TRAYMENU
Return

^+c::Send, {ALTDOWN}d{ALTUP}{CTRLDOWN}c{CTRLUP}
^+e::
  ; FileRecycle, %applicationname%.htm
  FileDelete, %applicationname%.htm
  FileAppend,,%applicationname%.htm
  Gosub,TRAYMENU
  Return
^+v::
  clipboard =   ;Empty the clipboard
  FileRead,clipboard,%applicationname%.htm
  Send,{CTRLDOWN}v{CTRLUP}
  clipboard =   ;Empty the clipboard
  FileDelete, %applicationname%.htm
  Return
^+q::
  FileDelete, %applicationname%.htm
  ExitApp
  Return

; IfWinActive,ahk_class IEFrame
OnClipboardChange:
If watch<>1
  Return
If A_EventInfo<>1
  Return
If changed=1
  Return
urls=
end=
Loop
{
  start=999999
  StringGetPos,pos1,clipboard,http,,%end%
  StringGetPos,pos2,clipboard,www,,%end%
  StringGetPos,pos3,clipboard,ftp,,%end%

  If (pos1>-1)
    start:=pos1
  If (pos2<start And pos2>-1)
    start:=pos2
  If (pos3<start And pos3>-1)
    start:=pos3
  If start=999999
    Break

  StringGetPos,pos4,clipboard,%A_Space%,,%start%
  StringGetPos,pos5,clipboard,%A_Tab%,,%start%
  StringGetPos,pos6,clipboard,`n,,%start%

  end:=start
  If (pos4>-1)
    end:=pos4
  If (pos5<end And pos5>-1)
    end:=pos5
  If (pos6<end And pos6>-1)
    end:=pos6
  If (end=start)
    StringLen,end,clipboard

  length:=end-start
  StringMid,url,clipboard,%start%,%length%
  If url<>
  {
    WinGetActiveTitle,title
    ; InputBox,title,%applicationname%,Please enter comment for`n%url%,,400,150,,,,,%title%
    ; If ErrorLevel=0
      StringReplace,TitleMinusIE,title, - Windows Internet Explorer
      AutoTrim Off
      urls=%A_Space%%A_Space%%A_Space%%urls%%url%  - %TitleMinusIE%`n
  }
}
If urls<>
{
  FileAppend,%urls%,%applicationname%.htm
}
GOSUB,TRAYMENU
Return



TRAYMENU:
Menu,Tray,DeleteAll
Menu,Tray,NoStandard
Menu,Tray,Add,%applicationname%,ADD
Menu,Tray,Default,%applicationname%
Menu,Tray,Add,
Menu,Tray,Add,&Add Url...,ADD
Menu,Tray,Add,&Edit Urls...,EDIT
Menu,Tray,Add,
Menu,Tray,Add,&Settings...,SETTINGS
Menu,Tray,Add,A&bout...,ABOUT
Menu,Tray,Add,E&xit,EXIT
Menu,Tray,Tip,%applicationname%
Return


EDIT:
RunWait,Notepad.exe %applicationname%.htm,,UseErrorLevel
Gosub,TRAYMENU
Return


ADD:
InputBox,url,%applicationname%,Please enter web address,,400,150,,,,,http://
If ErrorLevel<>0
  Return
InputBox,comment,%applicationname%,Please enter comment for`n%url%,,400,150
If ErrorLevel<>0
  Return
FileAppend,%url% - %comment%`n,%applicationname%.htm
Gosub,TRAYMENU
Return


OPEN:
StringSplit,url_,A_ThisMenuItem,%A_Space%-

If run=1
{
  IfNotInString,url_1,http
  IfNotInString,url_1,ftp
  url=http://%url_1%
  Run,%url_1%,,UseErrorLevel
}
If paste=1
{
  changed=1
  clipboard=%url_1%
}
Sleep,2000
changed=0
Return


SETTINGS:
Gosub,READINI
RunWait,Notepad.exe %applicationname%.ini
Gosub,READINI
Return


READINI:
IfNotExist,%applicationname%.ini
{
  ini=`;[Settings]
  ini=%ini%`n`;lines=20   `;number of lines to show in the tray menu
  ini=%ini%`n`;watch=1    `;1=yes 0=no  watch the clipboard for urls
  ini=%ini%`n`;run=1      `;1=yes 0=no  open the clicked url in the default browser
  ini=%ini%`n`;paste=1    `;1=yes 0=no  paste the clicked url to the clipboard
  ini=%ini%`n`;comment=1  `;1=yes 0=no  add a comment to the copied url
  ini=%ini%`n
  ini=%ini%`n[Settings]
  ini=%ini%`nlines=20
  ini=%ini%`nwatch=1
  ini=%ini%`nrun=1
  ini=%ini%`npaste=1
  ini=%ini%`ncomment=1
  FileAppend,%ini%,%applicationname%.ini
  ini=
}
IniRead,lines,%applicationname%.ini,Settings,lines
IniRead,watch,%applicationname%.ini,Settings,watch
IniRead,run,%applicationname%.ini,Settings,run
IniRead,paste,%applicationname%.ini,Settings,paste
IniRead,comment,%applicationname%.ini,Settings,comment
Return


ABOUT:
Gui,99:Destroy
Gui,99:Margin,20,20
Gui,99:Add,Picture,xm Icon1,%applicationname%.exe
Gui,99:Font,Bold
Gui,99:Add,Text,x+10 yp+10,%applicationname% v1.0.1
Gui,99:Font
Gui,99:Add,Text,y+10,Copies web page addresses and titles from Internet Explorer
; Gui,99:Add,Text,y+5,- Change settings using Settings in the tray menu
Gui,99:Add,Text,y+5,- Doubleclick the tray icon to add a url and comment manually

Gui,99:Add,Text,y+10,
Gui,99:Add,Picture,xm y+20 Icon5,%applicationname%.exe
Gui,99:Font,Bold
Gui,99:Add,Text,x+10 yp+10,1 Hour Software by Skrommel
Gui,99:Font
Gui,99:Add,Text,y+10,UrlCopy is based on Skrommel's UrlHistory, available at
Gui,99:Font,CBlue Underline
Gui,99:Add,Text,y+5 G1HOURSOFTWARE,www.1HourSoftware.com
Gui,99:Font

Gui,99:Add,Picture,xm y+20 Icon7,%applicationname%.exe
Gui,99:Font,Bold
Gui,99:Add,Text,x+10 yp+10,DonationCoder
Gui,99:Font
Gui,99:Add,Text,y+10,Please support the contributors at
Gui,99:Font,CBlue Underline
Gui,99:Add,Text,y+5 GDONATIONCODER,www.DonationCoder.com
Gui,99:Font

Gui,99:Add,Picture,xm y+20 Icon6,%applicationname%.exe
Gui,99:Font,Bold
Gui,99:Add,Text,x+10 yp+10,AutoHotkey
Gui,99:Font
Gui,99:Add,Text,y+10,This tool was made using the powerful
Gui,99:Font,CBlue Underline
Gui,99:Add,Text,y+5 GAUTOHOTKEY,www.AutoHotkey.com
Gui,99:Font

Gui,99:Show,,%applicationname% About
hCurs:=DllCall("LoadCursor","UInt",NULL,"Int",32649,"UInt") ;IDC_HAND
OnMessage(0x200,"WM_MOUSEMOVE")
Return

1HOURSOFTWARE:
  Run,http://www.1hoursoftware.com,,UseErrorLevel
Return

DONATIONCODER:
  Run,https://www.donationcoder.com,,UseErrorLevel
Return

AUTOHOTKEY:
  Run,http://www.autohotkey.com,,UseErrorLevel
Return

99GuiClose:
  Gui,99:Destroy
  OnMessage(0x200,"")
  DllCall("DestroyCursor","Uint",hCur)
Return

WM_MOUSEMOVE(wParam,lParam)
{
  Global hCurs
  MouseGetPos,,,,ctrl
  If ctrl in Static9,Static13,Static17
    DllCall("SetCursor","UInt",hCurs)
  Return
}
Return


EXIT:
ExitApp

Any ideas thus far?  Does anyone more knowledgeable and skilled (perhaps even Skrommel himself) want to "take this and run with it," bringing it closer to my original hopes of CopyAllUrls-like functionality?


*edit*
I did a lot of the modifications on this a while ago, before starting a "changelog."  But here's a relatively recent and very incomplete one:

0.1.3
Removed Skrommel's code that puts the URLs in the tray menu (below).  I hope this will fix the error message on extremely long URLs/titles, such as with Google Image results.
urls=
Loop,Read,%applicationname%.htm
{
  urls=%A_LoopReadLine%`n%urls%
  If (A_Index>lines)
    Break
}
Loop,Parse,urls,`n
{
  Menu,Tray,Add,%A_LoopField%,OPEN
}

0.1.2
Added a line to clear (erase) the HTML file of copied URLs when pasting!  Usually I was doing paste, clear - so why not combine the steps?  (Though this would be better as a user-defineable option, as would the shortcut keys...)


4
I may not know the depth of what I'm asking for, but here goes...

Would it be possible to have a program that, at a customizable system time or in 'x' mintes/seconds, makes sure that program 'y' is focused and sends it user-definable keystrokes?  And it'd be nice if this were "portable," not writing outside its own directory.

The situation prompting this request...
I'm recording a professor's lectures, and sometimes have to ditch class and leave the computer recording when he goes over-time.  After my next class, I come back and stop the recording--but this means that there's well over an hour of silence at the end of the recorded file!  And, even compressed, that takes up HD space, sometimes more than I have.  
So I was thinking it would be nice to have a program do something like, in my case, "in 10 minutes, switch to Reaper (going off of window titles?) and send key combination Ctrl+R (or whatever it is) to stop recording." (I guess by default, space is stop, but the possibility for key combinations--even a few combos in succession, maybe with "sleep" pauses in between, would maximize flexibility for other possible uses)

If anyone can help with this without too much trouble (or knows of something similar and portable), it'd be much appreciated!  Thanks!

*edit* - it's got a name now!

Pages: [1]