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 

Combine Explore Rooted & WinMove

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Antonimo



Joined: 28 Apr 2006
Posts: 55

PostPosted: Thu Jun 08, 2006 3:14 pm    Post subject: Combine Explore Rooted & WinMove Reply with quote

I have a shortcut icon on my desktop that points to
Code:
%SystemRoot%\EXPLORER.EXE /e, /root,
and using this, I am able to drag any folder from Windows Explorer onto the icon and a new Explorer window opens with the folder "rooted" (top level).

After this, I hit a hotkey combination to run a script to re-size and position the window:
Code:
;(WinMove, WinTitle, WinText, X-offset, Y-offset, width, height,
#0::
WinMove A, , 50, 100, 1400, 600,
Return


Can anybody say if it is possible to create a desktop shortcut to a compiled hotkey script that can achieve both of these tasks together?

The script could close after running or be a program sitting in the system tray, I don't mind, but I have failed to combine the two things myself.
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6836
Location: France (near Paris)

PostPosted: Thu Jun 08, 2006 3:28 pm    Post subject: Reply with quote

Code:
Run explorer.exe /e`, /root`, %1%
WinWaitActive ahk_class ExploreWClass
WinMove A, , 50, 100, 1400, 600

_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Antonimo



Joined: 28 Apr 2006
Posts: 55

PostPosted: Thu Jun 08, 2006 5:05 pm    Post subject: Reply with quote

Hi PhiLho,

and thanks for the solution.

I hadn't put the small inverted commas in the first line and I *forgot* to wait for the window to become active with WinWaitActive.

Thanks again Very Happy
Back to top
View user's profile Send private message
Antonimo



Joined: 28 Apr 2006
Posts: 55

PostPosted: Fri Jun 09, 2006 8:25 am    Post subject: Reply with quote

It was working fine until I used it with some folders that required longer to open.

The focus remained on the original folder so the newly opening folder was not re-sized.

I added a line to the script to make the script "sleep" for a half second.

Code:
Run explorer.exe /e`, /root`, %1%
Sleep, 500 ; 0.5 seconds
WinWaitActive ahk_class ExploreWClass
WinMove A, , 50, 100, 1400, 600
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6836
Location: France (near Paris)

PostPosted: Fri Jun 09, 2006 10:42 am    Post subject: Reply with quote

Another solution is to have the full path displayed in the title bar of Explorer (I have). So you can WinWaitActive for this title (ie. for the path to open). I didn't gave this solution as this is not the default setting.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Antonimo



Joined: 28 Apr 2006
Posts: 55

PostPosted: Thu Mar 05, 2009 11:42 am    Post subject: Reply with quote

This tiny script is used by me all day long to open explorer windows rooted to the specified folder.

After having used it for more than two and half years, I am trying to go a little further...

How could I create a small script that sits on the desktop and when a folder is dragged on to it, the script creates another AHK script on the desktop with the folder name included in the path?

Example of newly created AHK script:
Code:
Run explorer.exe /e`, /root`, F:\path\folder
Sleep, 500 ; 0.5 seconds
WinWaitActive ahk_class ExploreWClass
WinMove A, , 430, 200, 1200, 760
Back to top
View user's profile Send private message
Sakurako



Joined: 10 May 2007
Posts: 194
Location: China/ Canada

PostPosted: Thu Mar 05, 2009 12:43 pm    Post subject: Reply with quote

Code:
Loop %0%
 If InStr(FileExist(%A_Index%), "D")
  FileAppend, % "Run Explorer.exe /e```, /root```, " %A_Index%, % A_ScriptDir "\" SubStr(%A_Index%, InStr(%A_Index%, "\", "", 0) + 1) . ".ahk"
return

_________________
Sakurako ^_^
Back to top
View user's profile Send private message Visit poster's website
Antonimo



Joined: 28 Apr 2006
Posts: 55

PostPosted: Wed Mar 11, 2009 11:45 am    Post subject: Reply with quote

Hi Sakurako,

That's great, thanks.
Back to top
View user's profile Send private message
RTFM
Guest





PostPosted: Wed Mar 11, 2009 11:52 am    Post subject: Reply with quote

Quote:
After having used it for more than two and half years, I am trying to go a little further...
see You coming back again on 09/2011, right? Laughing
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
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