topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday October 31, 2024, 7:08 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.


Messages - mackal [ switch to compact view ]

Pages: [1]
1
Find And Run Robot / Re: what is happening in this key sequence?
« on: August 24, 2007, 03:51 PM »
Ugh, fudging $$cc to accomodate a kludge... ugliness.  No, the original regex situation must be solved.  And I think it has been.  I gave it some more thought, and here is the proper solution, or at least on way to do it cleanly:

^tor(?:rent)? ((?:[^-]|-(?!-))*)(?:\s*--\s*(.*))?()



Yes, it's hairy, but does things properly.

Explanation:

^tor(?:rent)?
    Same as before.

((?:[^-]|-(?!-))*)
    Capture group $$1: capture as many characters as possible, as long as they are not a dash, or a dash followed by anything other than a second dash.  The outer "()" pair does the capturing/extraction.  The inner "(?: ...)" is there to limit extent of "|", without capturing.  The "(?!-)" is a negative look-ahead: matches when next character is not a dash, but does not consume it.

(?:\s*--\s*(.*))?
    Capture group $$2.  The outer "(?: ....)" groups the expression without capturing.  The trailing "?" makes the whole chunk optional.  The "\s*" are there to strip any white space, although the first instance is futile (the previous capture group will gobble up its trailing white space... regex parsing is greedy).  The inner "(.*)" is the part that actually does the capturing/extraction of $$2.

the trailing ()
    This again was needed, in the case where "--" is not given on the command line.  In such cases $$2 does not exist, hence the "$$2" in the "Result Filter for RegEx" field is being treated as a literal string, rather than a variable.  This causes 0 matching results, unless one of the result hits contains a literal (unsubstituted) "$$2" string.

So with this regex you can go back to using $$1 instead of $$1$$3.

Hope this helps.

2
Ah, correct on both most recent posts, nitrix.  :Thmbsup:

3
Drat, I cannot make either of the scripts work, it seems.  I don't know why.  I even removed #IfWinActive selection, and mapped to left Alt, and still nothing happens.  nitrix, I take it those scripts worked for you, right? Odd...

EDIT: Ah, found the culprit.  At least on my system, I have to use

WinSet, Transparent, <value>, A

to point at the currently active window.  Without it, it refers to Last Found Window, which apparently is not set by anything in the scripts so far (according to docs).

4
Ah, of course, is there anything AHK cannot do?  I can just see it now... FARR v3.0 alpha, one massive AHK script...  ;)  Hey, it could happen... just look at GridMove... was that ever a shock when I discovered it's just an AHK script...  :D

Hmmm... this is too useful a script to just limit to FARR.  Many a time I've been in the same situation with other apps.  I just have to come up with a good universal hotkey for this functionality, one that will not interfere with any of my apps...

5
Really?  Too bad, would have been useful.  I assume that by overhead you mean the need to store for each result item the full scouring source information and such.  But perhaps when "show score break-down" is clicked, the search can be *rerun*, and as it progresses this time around the more expensive code path is chosen, the one which notes all the details.  That way things would be fast and lean during normal operation, as usual, and the extra load is only incurred on an introspective run through the search...  Just a thought; in all likelihood this approach is not even viable, I don't really know what the control flow of FARR is during its searches.  But hey, I can wish. :)

6
Ooh, great list!  Let me list mine, maybe I'll learn of some related/better tools. (I'm a tool junkie).

ESSENTIAL
- FARR, obviously
- Directory Opus - Explorer replacement, file management
- Notemap2 or Brainstorm - outliners
- PowerPro - swiss army knife, sort of
- Vim and/or Emacs - programmer's editors
- Zoom player - video player
- Faststone Image Viewer - image viewer
- safarp - uninstaller for Windows

IMPORTANT
- Super Flexible File Synchronizer - file synch
- Picasa2 - photo org
- ExamDiff - file comparison, esp text
- NOD32 AV - anti-virus
- Comodo Personal Firewall - firewall
- Opera - browser
- AutoHotKey - global key binder/scripter
- Console2 - dosbox/cmd replacement

7
Here's a scenario I constantly run into:
- doing stuff
- hey, what's a "pachydermus"?
- Ctrl-Space to bring up FARR
- start typing "search pachy...
- blimey, how do you spell that? darn, FARR is in the way, I can't see!

It be cool if there was a key that, in such cases, while typing in a string into FARR, could be held down to make FARR invisible or (partially) transparent temporarily (as long as the key is held down), so that the full workspace can be seen as it was prior to calling FARR.

8
This would be really cool, would help with tweaking the heuristics.  Is there such a function?  If not, then pretty please please please!  :D  Occasionally I don't like the sorting that comes out and I'd love to know why it came out the way it did...  Seems technically simple, and could be simply a new option in the context menu that you get when you right click on a result item.

9
Find And Run Robot / Re: what is happening in this key sequence?
« on: August 23, 2007, 07:39 PM »
Cool, thanks for the info.  So it's Perl-style regexp; that's great!  For anyone else interested, I'll save you the trouble of googling, the full syntax for the Perl regex is here:
    http://perldoc.perl.org/perlre.html

10
Find And Run Robot / duplicate search aliases
« on: August 23, 2007, 05:44 PM »
I'm using latest beta.  I notice that there are some duplications/conflicts in alias keywords on my system.  It is possible that this is due to left-over configuration from FARR 1.x.  In either case, I'll compile a list of what duplicates I've found here in case the FARR 2.0 code ever decides to cleanup such old configurations upon upgrade to 2.0 (or especially if this is just redundancy in 2.0 code)

  • "dc":  present in Core_Aliases/Websites and myaliases.alias
  • "cmd": present in nircmd plugin and myaliases.alias

It goes without saying that none of these were entered by me, but merely auto-generated by FARR at some point.  I'm sure I've seen more, will keep my eyes peeled.

11
Find And Run Robot / Re: what is happening in this key sequence?
« on: August 23, 2007, 05:25 PM »
Incidentally, does anyone know where to find the regexp language specification for the regex engine in FARR?  Mouser?  I presume FARR uses an off-the-shelf/Net library, so maybe the docs for that library will specify this...

12
Find And Run Robot / Re: what is happening in this key sequence?
« on: August 23, 2007, 05:19 PM »
So for example instead of:
^tor (.*)
You would match on
^tor (.*) [--(.*)]?

i could not make this to work but i'm really interested in making the filter optional
anyone knows how to solve that ?

Generally "[]" in regex means any character from within those listed between the square brackets (e.g., "[Ii]gnore [Cc]apitalization [Ii]n [Ww]ords"), so this does not work.  To make the second term optional, you really need

^tor (.*) (--(.*))?

But I'm not sure how FARR regexp engine handles nested groups (i.e., "()") as far as assigning them to $$1, $$2, etc.  In some regexp implementations there is a way to specify that a particular "()" is being used only for grouping, and not for extraction; not sure if FARR engine supports that.  If not, then probably the outer group is assigned to $$2, while the inner group to $$3... so you would have to use $$3 in the result filter box.

EDIT: Ah, found it through experimentation, FARR using emacs-like syntax... here is what you want:

^tor (.*) (?:--(.*))?

or to answer my original post

^tor(?:rent)? (.*) (?:--(.*))?

In this particular regex syntax "(?:foo)" means "group foo, but do not extract to a positional parameter".  Thus "tor(?:rent)?", for example, means match either "tor" or "torrent", and if the latter, don't let it affect the meaning of $$1, etc.

EDIT#2: Oops, the latter part, the alias filtering doesn't work because regex engines are greedy and thus the first "(.*)" always matches everything, including any "-- whatever bits here".  It's tricky to do this cleanly.  The workaround I came up with, which is a bit kludgy, is to use:

  ^tor(?:rent)? (?:(.*) -- (.*)|(.*))()

and then modify the torrent search engine invocations to something like

  Mininova | http://mininova.org/search/?search=$$1$$3 /ICON=icons\mininova.ico

Note the $$1$$3 instead of just $$1.

Explanation:

^tor(?:rent)?
    This part is the same as before.

(?:(.*) -- (.*)|(.*))
    Either match strings of form "xxx ... -- yyy ..." or, if not possible (i.e., "--" does not exist), match everything else.
    The outer "(?: ...)" groups the expression, limiting the scope of the "|", but does not cause parameter extraction itself.
    The problem with this, and the ugliness, is that in the case where "--" is absent and the second case is used, that last "(.*)" is assigned to $$3, and not $$1; hence the need for "$$3$$1".

the trailing "()"
    This is necessary in the case where "--" is present, since in this case the last "(.*)" is not used, and thus $$3 does not exist; what ends up happening is that "$$3" is left verbatim in the invocation string.  This extra "()" thus causes $$3 to exist (and be empty) in this scenario; in the alternate case it simply generates a blank $$4.

Oof.  Ugly, I know, but it works.  A greater regex master than I needs to tell us what the proper way of doing this is, if it is even possible to do cleanly.


   
   

13
Find And Run Robot / Re: what is happening in this key sequence?
« on: August 23, 2007, 03:33 PM »
The first one is easy and that is to make the regular expression for this group match on "tor[rent] (.*)" (whatever the regex for that is) -- that would solve the main problem.

I was also thinking that to enable filtering on regular expressions, we could add a special character that would filter and NOT get matched against regular expressions.  So for example you could type:
"tor searchword *FILTER WORDS"

and it would match as if you typed "tor searchword", and THEN do a filter on results using everything after the *.

Ah, everything is clear now, thanks!  I don't know much (yet) about the mechanics of FARR in how it approaches regex extraction, but your second suggestions sounds excellent!  

An alternative suggestion for the "stop parsing" token would be to use "--"... there is some precedent for this in the UNIX/commandline world, where the token "--" signals to the shell/launcher to stop parsing for command line flags (of the form "-o" or "--another-option"), and simply pass the remaning arguments wholesale to the program invoked, even if they start with a dash.  So in the above example it could be "torrent keyword1 keyword2 keywordn -- nova".

14
Find And Run Robot / Re: what is happening in this key sequence?
« on: August 23, 2007, 03:26 PM »
To launch all results i think it's now Ctrl+Alt+Enter (not just Ctrl+Enter).. i forget why.

Yes, that was it, thanks.  It would be helpful to amend the help file then, where it still has the old binding.  It's under Advanced Use > Hotkey and Shortcut Summary.

Muahahahaha! >:D  I feel like an evil overlord of the universe with all that power at my fingertips now...  :D

15
Find And Run Robot / what is happening in this key sequence?
« on: August 23, 2007, 02:09 PM »
Hi all, I am really starting to get excited about the power of FARR as I slowly discover the new things in 2.0... but occasionally I'm having a hard time understanding what FARR is thinking/doing.  Here is one example in particular, perhaps someone can explain to me what is happening:

  • I hit Ctrl-Space, and FARR comes up
  • I type "tor"; the first entry is the "torrent" alias group in Core_Aliases\Core-Search.alias file
  • I hit Tab or Alt-1, at which point the alias is autocompleted to "torrent" and only the aliases in the group now appear in the result window
  • now when I type the next word, the additional text is used to filter the alias group to only those entries that match the typed text; makes sense
  • once I narrowed down the list of torrent search engines so that the one I want is the only one (or at least at top of list), if I hit space and add another word (presumably the search words), the result list goes empty and hitting Enter does nothing

???

Now, I understand on the lowest level that the problem is that the additional words in the last point are being treated as additional filtering to the list of aliases in the group.  But, how do I enter an argument for $$1 in that case?  Is FARR not supposed to be used in this fashion? (i.e., autocompletion with alias groups)

Of course the workaround is to not hit Tab/autocomplete the alias, but simply use something like "tor my search words" and then use Alt-<number> to fire up the desired search engine.  But the outlined approach above should also work, no?

On a related note, is there way to fire *all* the search engines?  According to help, hitting Ctrl-Enter should execute all the search results, but this only fires up the top-most torrent search for me... I've never actually gotten Ctrl-Enter to work (but haven't really tried it with executables).

Any help on any of the above points would be most welcome.

16
FARR Plugins and Aliases / Re: New FARR Plugin: FCalc
« on: August 23, 2007, 10:54 AM »
This is a cool plugin, but could seriously use a pair of functions, say deg() and rad(), for converting between degrees and radians.  The trig functions assume that the arguments are in radians, whereas most quick calculations with FARR are bound to involve degrees (unless you're a mathie or doing math homework  ;) ).  So then we could type in "fc sin(rad(90))", for example.  Or perhaps the trig functions could be adapted to take degrees instead...

17
Find And Run Robot / Re: Custom Font Settings for FARR
« on: August 23, 2007, 03:07 AM »
Hi all,

I am having the same problem that tablaji was having with the clipped icons.  My DPI is set to "Normal 96" in Control Panel > Display > Settings > Advanced, and I am using Display Settings > Appearance > Effects > "Use large icons" option in Windows, since otherwise things are just way too tiny on my laptop (1680x1050 resolution).  But my explorer icon sizes look the same as in jgpaiva's screenshot, so I do not think I have "unusual" settings.  Can FARR be made to work with my setup?

EDIT: actually a few more observations:
  • if I turn off "Use large icons" and restart FARR, FARR's "large icons" work/look great!  (but need a microscope to use the icons on my desktop then...  :( )
  • if I then turn "Use large icons" back on, but do not restart FARR, I get the best of both worlds
  • Launchy has no problems with icon sizes, regardless what my desktop setting is

Surely this is an issue in how FARR obtains the icons, no?  If Launchy can do it...  :P  (it uses the large version of icons that are present when "Use large icons" is off, even when that setting is turned on... somehow it ignores the desktop setting and polls the correct-sized icon directly).

jgpaiva: my explorer window icon sizes match the ones in your attached pic.  Do you not have the same clipping problem when using large icons in FARR?  It sounds like you don't... I wonder what's different about my setup...

BTW, I'm using the latest beta, downloaded today.



18
ace and mackal,
so what's the verdict? does the ahk script work well yet?
when it's ready perhaps we can convince you to make a little .ahk/precompiled-exe zip file for easy download?

Well, it works well enough for me, although I've encountered the same problem as Justice, and was wondering how to implement options; but skrommel's solution sounds pretty good, I will try it out.  Other than that, I don't think I'll be babying/tweaking this script further, since it meets > 95% of my requirements.  I can put out an .ahk, but not sure how to convert to .exe...

19
Actually, it turns out that the SetWindowRedraw() approach wasn't working at all (DllCall() resulted in an ErrorLevel of -4, i.e., function not found), hence why I was so quick to dismiss your suggestion...  I've since found that DllCall("LockWindowUpdate", ...) works instead:

  http://msdn2.microso...ibrary/ms534869.aspx

Perhaps a difference of OSes? I am using WinXP... I think this does the same thing.  Even though it freezes the client area only, it actually makes a huge difference!  Thanks for pointing me down this road, skrommel!  :up:

Updated code, for those interested:
Spoiler
fs_engaged := 0      ; is "fullscreen" engaged for some window?
padding := 2      ; additional padding width to remove, in pixels

#Enter::
if (fs_engaged = 0) {
    ID:=WinActive("A")
    hwnd:=WinExist("A")
    DllCall("LockWindowUpdate",UInt,hwnd)
    WinGetPos, oldX, oldY, oldW, oldH   ; save old dimensions
    WinSet, Style, -0xC00000, ahk_id %ID% ; remove titlebar/WS_CAPTION
    WinSet, Style, -0x40000 , ahk_id %ID% ; remove borders/WS_SIZEBOX
    WinSet, AlwaysOnTop , On, ahk_id %ID%

    ;; work out current desktop resolution
    SysGet, m, Monitor
    desk_width := mRight - mLeft
    desk_height := mBottom - mTop

    WinMove, ahk_id %ID%,, -padding,-padding
       ,desk_width+2*padding, desk_height+2*padding

    DllCall("LockWindowUpdate",UInt,0)
    fs_engaged:=1
} else {
    ;; reverse all the operations performed above
    DllCall("LockWindowUpdate",UInt,hwnd)
    WinSet, AlwaysOnTop , Off, ahk_id %ID%
    WinSet, Style, +0xC00000, ahk_id %ID%
    WinSet, Style, +0x40000 , ahk_id %ID%
    WinMove, ahk_id %ID%,, oldX,oldY, oldW,oldH
    DllCall("LockWindowUpdate",UInt,0)
    fs_engaged:=0
}
WinSet, Redraw,,%ID%   ; optimization for Vista
         ; (not sure how this interacts with the new
         ; LockWindowUpdate calls...)

return


20
:) To prevent windows repainting, have a look at these API functions:


SendMessage(hwnd, WM_SETREDRAW, FALSE, 0)
SendMessage(hwnd, WM_SETREDRAW, TRUE, 0)

or

SetWindowRedraw(hwnd, FALSE)
SetWindowRedraw(hwnd, TRUE)

Try something like
hwnd:=WinExist("A")
DllCall("SetWindowRedraw",UInt,hwnd,UInt,1)
Skrommel

If I understand this correctly, it prevents repaints to the window's client area, right?  I misworded my intention: I was wondering about getting Window's to freeze display of the WHOLE window.  Currently, I can see the window lose its border, then caption, then move and resize, all steps seperate but in quick succession; instead I would like to have the window go directly from its initial configuration to its final look DIRECTLY.  Not sure how doable it is with just AHK though...

21
  • fullcreen app always goes to screen 1: feature or bug? you decide
  • I see a pixel or two on screen 2 (right border) edit: ahh one of the two variables (padding to 0 solves it  :Thmbsup:
  • add WinSet, Redraw,,%ID% before end of subroutine to prevent screen redrawing options on vista!

Yes, I totally ignored multi-monitor setup in that script, mostly because I don't use one most of the time.  It also made the script simple; with a multi-monitor setup where you potentially can have a fullscreened app on each monitor, you're going to have to get more fancy: not only do you have to memorize which app is fullscreened on which screen, but you also have to work out what an un-fullscreen keystroke is to do (i.e., there are a number of "logical" ways to interpret such a keystroke then).

Interesting about "padding".  I used it to eliminate some extra "glare" around the screen border... if I set padding=0 and fullscreen a dark background window, then the around the edge of the screen I'll get a bright outline 1- or 2-pixels wide.  Hence "padding=2", which actually I meant to call "anti-padding".  But if you say that this causes the window to stick out onto the next screen, then... I see, I guess just stripping the window border and titlebar leaves the window's client area still in some sort of container window which shows through by 1- or 2-pixels around the client area.  I wonder what a clean way of getting rid of that would be.  That extra border is annoying, especially considering that the whole point of fullscreening the app, at least for me, is to eliminate any visually distracting elements...

I'll have to look up that Redraw bit you mentioned.  I'm running on WinXP SP2, hence haven't run into the issue.  Actually, speaking of redraws, I wish there was a way to tell AHK/Windows to "freeze" the window display untill all the operations (stripping of window parts, moving, resizing) are done, to avoid the "repainting"/flashing effect that such a quick succession of operations produces...

22
:tellme: Oh no, Fullscreen is not simple! Try starting Outlook Express and Alt-LeftClick in the message window. Now the message window fills the screen, but if you move the mouse to any screen edge, that hidden part is automatically revealed! It's just amazing!

Sorry, that came out wrong: I meant that the functionality of it that I needed (i.e., just a simple fullscreen) is what was simple.  Clearly the Fullscreen app you mentioned can do tons more.  In my case I am fairly sure I wouldn't end up using the rest of the features in the long term... (I am finding I am most productive with my tools when I K.I.S.S. [Keep It Simple, Stupid].)

23
Neat, AHK rules!  :Thmbsup:  Tossed this little thing up, based on input from AHK forum:

fs_engaged := 0 ; is "fullscreen" engaged for some window?
padding := 2 ; additional padding width to remove, in pixels

#f::
if (fs_engaged = 0) {
    ID:=WinActive("A")
    WinGetPos, oldX, oldY, oldW, oldH ; save old dimensions
    WinSet, Style, -0xC00000, ahk_id %ID% ; remove titlebar/WS_CAPTION
    WinSet, Style, -0x40000 , ahk_id %ID% ; remove borders/WS_SIZEBOX
    WinSet, AlwaysOnTop , On, ahk_id %ID%

    ;; work out current desktop resolution
    SysGet, m, Monitor
    desk_width := mRight - mLeft
    desk_height := mBottom - mTop

    WinMove, ahk_id %ID%,, -padding,-padding
    ,desk_width+2*padding, desk_height+2*padding

    fs_engaged:=1
} else {
    ;; reverse all the operations performed above
    WinSet, AlwaysOnTop , Off, ahk_id %ID%
    WinSet, Style, +0xC00000, ahk_id %ID%
    WinSet, Style, +0x40000 , ahk_id %ID%
    WinMove, ahk_id %ID%,, oldX,oldY, oldW,oldH
    fs_engaged:=0
}
return

This works perfectly for my purposes.  Fullscreens currently active app on Win-F keypress, unless one has already been fullscreened earlier, in which case it restores the old window dimensions.  Any AHK stylistic/efficiency remarks quite welcome though... it's my first nontrivial script...

24
:) Try Fullscreen at http://www.fanix.com/fullscreen.html. Shareware, sluggish on Vista, but unlike anything else.

Skrommel
Not bad (good find! my Googling did not turn it up), but a bit pricy for such a simple function.  The project looks totally "doable" in AutoHotKey... that's probably the way I'll go, although I am currently a complete AHK noob (well, an AHK keyboard remap for a single game doesn't really count).  Can any AHK pros here offer any suggestions on how to go about it? (BTW, I love GridMove!  For the first time it made me realized the full power of AHK...)  I fielded a similar question on the AHK forums, but if the local experts can offer anything beyond that, by all means, I need all the help I can get!  ;)

Here's the AHK forum thread:
  http://www.autohotke...28e2504acfe9bedf78a2

25
Hello,

I would love to find out if any of you readers knows of a tool which can fullscreen any arbitrary application.  By that I mean that it maximizes an app to the point where only the window's client area is visible, with the window's caption/title/border and the Windows taskbar being hidden or off-screen.  My main desire for this is to turn a number of my favourite apps into distraction free tools, especially my favourite editor (Vim), much like the recently reviewed Dark Room and Writer tools.  BTW, I'm running on WindowsXP.  I know there are some nice solutions under Linux (a number of window managers support this directly) and probably Mac too...

Pages: [1]