AutoHotkey Community

It is currently May 26th, 2012, 11:57 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: August 18th, 2009, 10:34 am 
Offline

Joined: August 18th, 2009, 10:20 am
Posts: 3
Two of my favourite tools for file management are the bookmarking tool Direct Folders and the Explorer replacement Xplorer2. Unfortunately they are not integrated with one another so I've written an AHK script to change folders in Xplorer2 my using the Direct Folders tray icon. Here's how it works:

Create an AHK script to switch to Xplorer2, focus on the address bar and send the value of the parameter that was provided:
Code:
WinActivate, xplorer
Send, {ShiftDown}{Tab}{ShiftUp}
SendInput, %1%
Send, {Enter}
return


In the Options tab of Direct Folders' configuration set the "Open folder in" value to be "Custom" and to run the AHK script (eg "C:\AHK\AutoHotkey.exe C:\Dev\AHK\directxplorer.ahk")

(direct folders will automatically send the selected path as a parameter)

For this to work Xplorer2 must already be open and I'm sure that the AHK code can be improved - perhaps to speed up the send of the path to xplorer.

Issue: Sometimes it seems to paste an extra quote at the end of the path for certain bookmarks. If this happens I recreate the bookmark and goes away. You could improve the script to check for and remove the quote.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: August 22nd, 2009, 1:24 pm 
Offline

Joined: April 11th, 2006, 11:46 am
Posts: 10
Location: The Netherlands
vivadixie wrote:
For this to work Xplorer2 must already be open and I'm sure that the AHK code can be improved - perhaps to speed up the send of the path to xplorer.

Issue: Sometimes it seems to paste an extra quote at the end of the path for certain bookmarks. If this happens I recreate the bookmark and goes away. You could improve the script to check for and remove the quote.


This was I use as a reliable solution to open directories over command line:
Code:
; Explorer2 Opener - Command Line Script -- by Winkie
; -- Version: 1.0 -- Last update: 7 Oct 2007

#NoTrayIcon
#SingleInstance, Force

If 0 <> 1
   ExitApp

StringReplace, 1, 1, ",, All
vVar = %1%

IfWinExist, ahk_class ATL:ExplorerFrame
{
   WinActivate ahk_class ATL:ExplorerFrame
   funcChangeFolder( vVar )
}
Else
{
   Run, c:\program files\zabkat\xplorer2_lite\xplorer2.exe, , Max, vPid
   WinWait, ahk_pid %vPid%
   Sleep, 5000
   WinActivate,ahk_pid %vPid%
   funcChangeFolder( vVar )
}
ExitApp
Return

funcChangeFolder( pTarget )
{
   ControlGetPos, vEdit1Pos,,,, Edit1, A
   If vEdit1Pos <>   ; It has an Edit1 Control.
   {
      ControlSetText, Edit1, %pTarget%, A
      ControlFocus Edit1, A
      ControlSend, Edit1, {Right}{Enter}, A
   }
}

_________________
Winkie


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 29th, 2009, 10:44 am 
Offline

Joined: August 18th, 2009, 10:20 am
Posts: 3
Thanks Winkie, works very well


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 30th, 2009, 6:06 pm 
Offline

Joined: April 11th, 2006, 11:46 am
Posts: 10
Location: The Netherlands
vivadixie wrote:
Thanks Winkie, works very well
You're welcome.

_________________
Winkie


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 8th, 2009, 10:41 am 
Offline

Joined: August 18th, 2009, 10:20 am
Posts: 3
also, the following will simulate the opening of direct folders using the middle button (assuming the Win+9 is set as the keyboard shortcut for opening direct folders)

Code:
#IfWinActive, ahk_class ATL:ExplorerFrame
MButton::#9


Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 27th, 2010, 4:15 am 
In Direct Folders, select:

Open folder in: Custom

Custom command: c:\Program Files\zabkat\xplorer2_lite\xplorer2_lite.exe /R:%1 /1

OBS: the "/1" is optional. I use it to force a single pane.

It works very well this way.

xPlorer2 command lines: http://www.zabkat.com/x2h_7.htm


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, Bing [Bot], Google Feedfetcher and 54 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