 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Antonimo
Joined: 28 Apr 2006 Posts: 55
|
Posted: Thu Jun 08, 2006 3:14 pm Post subject: Combine Explore Rooted & WinMove |
|
|
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 |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6836 Location: France (near Paris)
|
Posted: Thu Jun 08, 2006 3:28 pm Post subject: |
|
|
| 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 |
|
 |
Antonimo
Joined: 28 Apr 2006 Posts: 55
|
Posted: Thu Jun 08, 2006 5:05 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
Antonimo
Joined: 28 Apr 2006 Posts: 55
|
Posted: Fri Jun 09, 2006 8:25 am Post subject: |
|
|
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 |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6836 Location: France (near Paris)
|
Posted: Fri Jun 09, 2006 10:42 am Post subject: |
|
|
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 |
|
 |
Antonimo
Joined: 28 Apr 2006 Posts: 55
|
Posted: Thu Mar 05, 2009 11:42 am Post subject: |
|
|
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 |
|
 |
Sakurako
Joined: 10 May 2007 Posts: 194 Location: China/ Canada
|
Posted: Thu Mar 05, 2009 12:43 pm Post subject: |
|
|
| 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 |
|
 |
Antonimo
Joined: 28 Apr 2006 Posts: 55
|
Posted: Wed Mar 11, 2009 11:45 am Post subject: |
|
|
Hi Sakurako,
That's great, thanks. |
|
| Back to top |
|
 |
RTFM Guest
|
Posted: Wed Mar 11, 2009 11:52 am Post subject: |
|
|
| 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?  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|