Ctrl + 0-9 to activate TAB (file) 1 - 10 [solved]

Help with writing and running scripts

Ctrl + 0-9 to activate TAB (file) 1 - 10 [solved]

Postby hugov » Sun Jul 12, 2009 5:34 am

Hi,

if you use Firefox you might be familiar with the CTRL+1, CTRL+2 etc to activate the first, second etc tab.

In UE 14 I had made a AHK (Autohotkey) script to do exactly the same, but in UE15 the script broke and it is not longer possible (to my knowledge) to do in AHK due the changes in UE15.

I wonder if there is a script that does the same as with Firefox. If you have more than two files open it is a great timesaver to be able to jump to the first 1 (first file) or 5th one. It saves you the hassles of mutiple ctrl-(shift)-tabbing.

Or I'm missing some "hidden" feature that already makes this possible?

Thanks in advance! (I have no knowledge of UE scripting)
hugov
Newbie
 
Posts: 8
Joined: Sun Jul 12, 2009 5:27 am

Re: Request: Ctrl + 0-9 to activate TAB (file) 1 - 10

Postby Mofi » Sun Jul 12, 2009 7:22 am

If you want to activate a document directly with a hotkey, you can do this by writing scripts and assign the hotkeys to the scripts. The script code is quite simple. Here is the example for activating document 3.

if( UltraEdit.document.length >= 3 ) UltraEdit.document[2].setActive();

You need 10 scripts each having just 1 line.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4039
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Request: Ctrl + 0-9 to activate TAB (file) 1 - 10

Postby hugov » Mon Jul 13, 2009 3:22 am

Thanks, it works but not too well. You must release the CTRL key before you can switch to another document. So CTRL-1-3-5 to switch between 1 3 and 5 is not possible (without releasing CTRL). Should be standard feature IMHO (configurable).
hugov
Newbie
 
Posts: 8
Joined: Sun Jul 12, 2009 5:27 am

Re: Request: Ctrl + 0-9 to activate TAB (file) 1 - 10

Postby danne » Mon Jul 13, 2009 8:36 am

You know, UE is way older than FF. So, "standard feature" is ... As Mofi pointed out, you can configure it through the script interface. I am however also not a fan of having to press a key-modifier again after executing a script to type f.ex a " (you get a 2 (swe keyb layout) if not pressing shift again as opposed to keeping shift pressed). Guess that depends on how the keyboard buffer is handled. That's another discussion tho.

Personally I have absolutely no use for the feature. I always have way more than ten files open so I don't use the tabs (I prefer the file view, tho I wouldn't mind being able to tweak it and remove the other tabs in there which I never use (ie. Project, Explorer and Lists)). I unfortunatly have to have the tabs hidden away as otherwise the script property UltraEdit.document.length is borked. That'll be fixed tho so I can finally get rid of them completely =)
User avatar
danne
Basic User
Basic User
 
Posts: 36
Joined: Mon Feb 07, 2005 12:00 am

Re: Ctrl + 0-9 to activate TAB (file) 1 - 10 [solved]

Postby hugov » Mon Jul 13, 2009 9:30 am

@danny: other application have this feature too but I mentioned FF just to illustrate it. Besides Google Chrome and IE7 and IE8 (probably opera?) use the same ctrl-0-9

I don't like the file listing window at all but find the tabs useful, especially with CTRL-0-9 (or any shortcut you like for that matter)

Edit: I've been using UE since version 4 or something, a number of my requests are now default functions of UE so just wait and see about this one :-)
hugov
Newbie
 
Posts: 8
Joined: Sun Jul 12, 2009 5:27 am

Re: Ctrl + 0-9 to activate TAB (file) 1 - 10 [solved]

Postby roland » Tue Jul 14, 2009 9:24 am

The reason you have to release the Ctrl key between script executions is because the Cancel dialog steals the focus of the keyboard and 'cancels' the Ctrl key press.

I have requested that IDM add an option similar to what is available for macros to suppress the cancel dialog and allow multiple ctrl presses. Please send in a report for yourself, too.
User avatar
roland
Basic User
Basic User
 
Posts: 30
Joined: Sun Aug 15, 2004 11:00 pm

Re: Ctrl + 0-9 to activate TAB (file) 1 - 10 [solved]

Postby danne » Wed Jul 15, 2009 6:36 am

Good idea roland. I never really thought about that as the script is so fast the dialog doesn't even show for me (used for snippets).
User avatar
danne
Basic User
Basic User
 
Posts: 36
Joined: Mon Feb 07, 2005 12:00 am

Re: Ctrl + 0-9 to activate TAB (file) 1 - 10 [solved]

Postby Mofi » Sat Jul 30, 2011 1:42 pm

Good news for all users of scripts with assigned hotkeys.

With UltraEdit v17.10.0.1015 it is possible to execute a script several times by hotkey by just pressing the keys and hold them for repeated execution respectively hold Ctrl / Shift / Alt permanently and pressing just the additional key to execute the script once on every key press of the additional key.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4039
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Ctrl + 0-9 to activate TAB (file) 1 - 10 [solved]

Postby hugov » Fri Aug 05, 2011 9:19 am

Good news indeed, just tried it and it works. What a joy.
hugov
Newbie
 
Posts: 8
Joined: Sun Jul 12, 2009 5:27 am


Return to Scripts