AutoHotkey Community

It is currently May 27th, 2012, 12:45 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: March 23rd, 2010, 12:40 am 
Offline

Joined: January 13th, 2008, 6:00 pm
Posts: 115
This code is working nicely in Windows 7, but I'm curious if there are any adjustments necessary for Windows Vista or XP. Since the path isn't necessarily in the Explorer window title, I got it from the window text ("Address: "). Any feedback would be appreciated, especially to make it more reliable for getting folder paths from Windows Explorer.

Code:
;~ ; Add Open Folders to Links
GroupAdd, opensavedialog, ahk_class #32770
GroupAdd, opensavedialog, Open
GroupAdd, opensavedialog, Save As
GroupAdd, opensavedialog, Save
GroupAdd, opensavedialog, Import
GroupAdd, opensavedialog, Export
Loop
   {
      WinWaitActive, ahk_group opensavedialog
      thisdialog := WinExist("A")
      SetTitleMatchMode, RegEx
      match:="ahk_class (?:Cabinet|Explore)WClass"
      WinGet, wList, List, %match%
      Loop % wList {
         WinGetText, wintxt, % "ahk_id " wList%A_Index%
         StringGetPos, ret, wintxt, `r`n
         wPath := SubStr(wintxt, 10, ret - 9)
         SplitPath, wPath, name
         IfExist, C:\Users\%A_UserName%\Links\%name%.lnk
            Break
         FileCreateShortcut, %wPath%, C:\Users\%A_UserName%\Links\%name% OPEN.lnk, , , %A_Now%
      }
      SetTitleMatchMode, 1
      ControlClick, SysTreeView321, ahk_id %thisdialog%,,,,,NA ; refresh Favorites/Links in Sidebar
      Send, {F5}
      WinWaitClose, ahk_id %thisdialog%
      FileDelete, C:\Users\%A_UserName%\Links\*OPEN.lnk
   }


Thanks to sinkfaze for his help.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon, maul.esel, Yahoo [Bot] and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group