AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Favorite Folders popup menu that you can change on the fly.
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
webber



Joined: 25 Aug 2005
Posts: 60

PostPosted: Tue Aug 30, 2005 7:19 pm    Post subject: Reply with quote

ChrisM wrote:

Or are you thinking of having the File->Open dialog as the default action?

Such as on an empty desktop with no app running selecting a shortcut from your FavoritesFolder menu would open a certain app and then open the File->Open dialog and then switch to that folder?


yes that's close, I was thinking of having the File->Open dialog as the default action.

Without opening any app., such as on an empty desktop, selecting a shortcut from your FavoritesFolder menu would open a File->Open dialog to that folder.

is this possible ?
_________________
winxp pro sp2
AHK v1.0.38.02

----------------------------------
One man's preacher is another man's terrorist
Back to top
View user's profile Send private message
ChrisM



Joined: 28 Nov 2004
Posts: 58

PostPosted: Tue Aug 30, 2005 7:46 pm    Post subject: Reply with quote

I think the File->Open dialog has to be connected to some kind of app.
Explorer is kind of like a general purpose Open dialog, you can open any file in any app or run a file from there.
Maybe you need to explain a little more
Quote:
selecting a shortcut from your FavoritesFolder menu would open a File->Open dialog to that folder.

What do you want to happen after the folder is in the File->Open dialog?
_________________
ChrisM
Back to top
View user's profile Send private message
webber



Joined: 25 Aug 2005
Posts: 60

PostPosted: Tue Aug 30, 2005 10:22 pm    Post subject: Reply with quote

I think I have something close to what I was attempting to achieve. It does require having an application open though.

I assigned the favorites folder macro to hotkey F4 (I don't have a middle mouse button),

I modified the function f_OpenFavorite with:

Code:

  ;Run, %f_command%
 
  ;Revised to work without Explorer
  ;------------------------------------------------------
   WinActivate,"Open File(s)"
   Send %f_path%



and I modified the function f_DisplayMenu with:

Code:

f_DisplayMenu:
     Send !F
    Send O
    sleep 250



this avoids using explorer





..
_________________
winxp pro sp2
AHK v1.0.38.02

----------------------------------
One man's preacher is another man's terrorist
Back to top
View user's profile Send private message
savage



Joined: 02 Jul 2004
Posts: 206

PostPosted: Wed Sep 14, 2005 5:47 pm    Post subject: Reply with quote

As requested, here is my new version of the script with submenu support:
Code:
Comment from moderator: Large script removed because I believe the very first post of this topic contains the updates that were here.

Just make subfolders in your current shortcuts folder and put some shortcuts in there. They'll show up as submenus.
_________________
<enormous animated gif>
Back to top
View user's profile Send private message AIM Address
ML
Guest





PostPosted: Wed Sep 14, 2005 6:34 pm    Post subject: Reply with quote

I've been hoping that this would appear--thanks!

When I try to open a shortcut that's in a subfolder though, nothing happens. This is is the case if I'm using the script on its own, so to speak, or in an open-save dialogue. Any idea what the problem could be? There's no error message; it's just that nothing happens.
Back to top
webber



Joined: 25 Aug 2005
Posts: 60

PostPosted: Thu Sep 15, 2005 12:16 am    Post subject: Reply with quote

ML wrote:

When I try to open a shortcut that's in a subfolder though, nothing happens. This is is the case if I'm using the script on its own, so to speak, or in an open-save dialogue. Any idea what the problem could be? There's no error message; it's just that nothing happens.


I find similar problems. Functionality seems to depend on where I'm at.

If I have an application open, press the hotkey, and simply try to use the Favorites menu nothing happens.

if I have an application open and select File-> open then I have to press the hotkey to use the menu. sometimes the Favorites menu appears.


It would be nice:

--if an application is open and file->open is selected the favorites menu would appear.

--if no application is open, hotkey is activated, menu item selected, then explorer is opened to location, or file is opened in default application.
_________________
winxp pro sp2
AHK v1.0.38.02

----------------------------------
One man's preacher is another man's terrorist
Back to top
View user's profile Send private message
savage



Joined: 02 Jul 2004
Posts: 206

PostPosted: Thu Sep 15, 2005 12:40 am    Post subject: Reply with quote

Quote:

Any idea what the problem could be?


No clue. I just tested it and it works fine for me. You're saying that shortcuts that aren't in subfolders work fine? What's the structure of your favorites folder look like?

Quote:

Functionality seems to depend on where I'm at.


Ummm.. that's the point. In Open/Save dialogs it changes the folder or opens a file, in explorer it changes the file, in console windows it cd's, and if you set it to always open the menu it runs explorer if you're not over a supported window. Keep in mind that some Open/Save dialogs - Office's for example - don't work, though this is changed fairly easily.

Quote:

If I have an application open, press the hotkey, and simply try to use the Favorites menu nothing happens.


It's not designed to just magically work in every program ever conceived. If you want it to just work in some application without manually opening the open/save dialog you can add support yourself. All you have to do is write an else if block like this:

Code:

  else If f_class in ConsoleWindowClass,Console Main Command Window ; In a console window, CD to that directory
  {
    WinActivate, ahk_id %f_window_id% ; Because sometimes the mclick deactivates it.
    SetKeyDelay, 1  ; This will be in effect only for the duration of this thread.
    IfInString, f_path, :  ; It contains a drive letter
    {
      StringLeft, f_path_drive, f_path, 1
      Send %f_path_drive%:{enter}
    }
    Send, cd %f_path%{Enter}
    return
  }


And add it to f_open_favorites.

Quote:

if an application is open and file->open is selected the favorites menu would appear


I don't think there's any way to tell what menu item the user has the mouse over. Even if you could, the action would just amount to opening up the dialog for you and putting in the filename as before. It saves you what? 1 click? Not worth it if you ask me.

Quote:

file is opened in default application.


That's a good idea. To be honest it never even occured to me before now to put shortcuts to files on the menu - I'd always just used it for folders. This shouldn't be to difficult to implement so I'll take a stab at it.
_________________
<enormous animated gif>
Back to top
View user's profile Send private message AIM Address
webber



Joined: 25 Aug 2005
Posts: 60

PostPosted: Thu Sep 15, 2005 1:43 am    Post subject: Reply with quote

Quote:
Ummm.. that's the point. In Open/Save dialogs it changes the folder or opens a file, in explorer it changes the file, in console windows it cd's, and if you set it to always open the menu it runs explorer if you're not over a supported window.


Except it's not working as described

EDIT:
=============
Here's what I've done to make it work with any application and avoid opening in explorer :

I use "Quick Buttons". A handy free application which creates buttons in an auto hide toolbar. Buttons hold macros which will send keys to the computer.

1. assign hotkey (such as F4 ) to Favorites code
2. install quick buttons and create a button with two commands:

{Ctrl+O}
{F4}

3. modify Favorites code

from :

-- Run, explorer "%f_path%"

to:

;Run, explorer "%f_path%"

;Revised to work with quick buttons instead of Explorer
;------------------------------------------------------
WinActivate,%f_addFavorite%
Send %f_path%
sleep 250
Send !o
_________________
winxp pro sp2
AHK v1.0.38.02

----------------------------------
One man's preacher is another man's terrorist


Last edited by webber on Fri Sep 16, 2005 8:04 am; edited 1 time in total
Back to top
View user's profile Send private message
Hotfoot



Joined: 14 Sep 2005
Posts: 21

PostPosted: Thu Sep 15, 2005 3:59 am    Post subject: Reply with quote

Thanks for posting the script, savage!

I'm also having problems with submenu links portion of the script. The submenu links do nothing -- just as ML said. With Explorer, when an item is clicked, the menu/submenu disappears but Explorer does not move to the submenu link location. Just to make sure, I started with a new empty favorites folder and added new links and submenu links -- same result: submenu links are non-functional. Within Open/Save as dialog windows, submenu links are also non-functional. I tested it with savage's script as is.

I'm using WinXP, AutoHotkey 1.0.38.03

Just curious, does the script work for other people?
Back to top
View user's profile Send private message
savage



Joined: 02 Jul 2004
Posts: 206

PostPosted: Thu Sep 15, 2005 4:37 pm    Post subject: Reply with quote

I tested the script with the newest version of ahk and it worked fine. On a hunch I changed my favorites folder to one with spaces in it and the sub menus stopped working as described. So if that's the case for you, I'll dig in the code and see where exactly the problem is. In the meantime I suppose you could move your favorites folder.

EDIT: Ah, the spaces were being trimmed off by ahk when the string was being built in Hex2String. The fix is to small too merit reposting the entire script so just replace the existing Hex2String with this one:

Code:

Hex2String(x)                 ; Convert a huge hex number starting with X to string
{
   Autotrim, off
   StringTrimLeft x, x, 1     ; discard leading X
   StringLen len, x
   Loop % len/2               ; 2-digit blocks
   {
      StringLeft hex, x, 2
      Transform y, Chr, % "0x"hex
      string = %string%%y%
      StringTrimLeft x, x, 2
   }
   Return string
}


If your problem is the spaces in the foldername thing like I suspect it was, this should solve it.
_________________
<enormous animated gif>
Back to top
View user's profile Send private message AIM Address
ML
Guest





PostPosted: Thu Sep 15, 2005 6:41 pm    Post subject: Reply with quote

Savage, thanks for posting the revised section--the subfolder items now work for me in open/save dialogues. And thanks again for the script, period!

Is there a reason why your script with subfolders doesn't include the revisions that allowed the earlier version to work in MS Office dialogues?
Back to top
savage



Joined: 02 Jul 2004
Posts: 206

PostPosted: Thu Sep 15, 2005 7:39 pm    Post subject: Reply with quote

I pulled this right out of my personal script and I rarely need to use office. I didn't see the need to put them in. Usually when I pull stuff out of my script and release it, I fix it enough to make it work for everyone but don't bother with stuff that I have no need for. The displaying parts of my script are almost identical to the previous versions, so you should be able to just copy and paste the officey bits.
_________________
<enormous animated gif>
Back to top
View user's profile Send private message AIM Address
ML
Guest





PostPosted: Fri Sep 16, 2005 5:26 am    Post subject: Reply with quote

[The displaying parts of my script are almost identical to the previous versions, so you should be able to just copy and paste the officey bits.]

Yep--I just looked for and added the lines with the "jh0105" tag. Thanks.

Another question though--when you add a folder, the script-with-subfolders opens a blank box in which to type a shortcut name. Earlier versions of this script begin the name of the folder, which you can accept or change. (I.e., the name of the folder minus everything in the path that precedes it.) Is there a simple way to get the folder name to appear in the script-with-subfolders? I tried "merging" the old script with the new, without success. (I'm not a programmer, just someone who loves cool tools!)
Back to top
ChrisM



Joined: 28 Nov 2004
Posts: 58

PostPosted: Sat Sep 17, 2005 4:09 pm    Post subject: Reply with quote

Chris:
Could you please alter the very first post in this thread so that I can edit it? I would like to add all the changes and give a rev history so new comers don't have to sift thru all the pages.

savage:
Could you please explain why the functions String2Hex(x) and Hex2String(x) are needed? I've found that using your script, when clicking on a submenu item, aprox. 1 time out of 20 I'm taken to the wrong folder. So as a test I deleted those functions and the refrences to them and the submenu items work fine in all situations I could think of.

Thanks
_________________
ChrisM
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sun Sep 18, 2005 1:57 am    Post subject: Reply with quote

ChrisM wrote:
Could you please alter the very first post in this thread so that I can edit it?
I don't think there's any built-in way to assign a guest post to a user, even though I know it's yours. If you want, I can edit it to simply say "see below for latest version of script"; then you can edit your non-guest post that appears a little ways below it.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
Page 6 of 10

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group