ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: Create folder structure or path

<< < (2/4) > >>

IainB:
@MilesAhead: That Code Project bit was spot-on.  :Thmbsup:
I was just wondering how to put that code into an AHK script (I am a beginner in AHK) when your post with the script popped up. Thanks! Nice work and smart thinking, Batman - if you don't mind my saying so! (...and at the risk of further inflating your possibly already over-inflated ego).   ;D

MilesAhead:
Overinflated?  I was just thinking my humility has been holding me back all these years!! heh heh

Thank you.  I'm glad the OP posted the question because I'm new to ahk too and I didn't know that function was there.  Now I also have another handy small util.

I compiled it and zipped it up with a readme:

http://www.favessoft.com/hotkeys.html

Just scroll to the bottom of the page to download.

MilesAhead:
I changed the program so that it doesn't use the script path as the working directory and added a command line param. The "working directory" is now the current directory of the command prompt, or the Start In value if run from a shortcut.  For relative paths if you type
CreateDir test\test
and the command prompt is in c:\temp
the result should be
c:\temp\test\test

it still pops up an InputBox with the command line already entered so that you can confirm that's the folder you want to create, or cancel.

It's available for download now.


Target:
here's another try -


--- ---#singleinstance
#persistent
outpath:="::{20d04fe0-3aea-1069-a2d8-08002b30309d}"
return

$F11::
fileselectfolder, OUTPATH,*%OUTPATH%,3
Path_tmp:= outpath

loop, parse, clipboard,`n,`r
{
filegetattrib, myATTRIB, %A_loopfield%
ifnotinstring, myATTRIB, D
{
Stringgetpos,myPOS,a_loopfield,\,R
stringleft, mySTRING, a_loopfield, %MyPos%
}
else
MySTRING:=a_loopfield

if substr(mySTRING,2,1) = "`:"
stringtrimleft,mySTRING, mySTRING,3

loop, parse, mySTRING,\
{
filecreatedir,%path_tmp%\%a_loopfield%
Path_tmp.= "\" . a_loopfield
}
mySTRING:=
MyPOS:=0
PATH_tmp:=outpath
}
return


runs all the time, copy a folder (CTRL+C) and use the hotkey (F11) to duplicate the folder and it's associated path in the folder of your choice (you get a prompt to select the target dir when you use the hotkey

also works with files (the file name is stripped out of the path), and with multiple folder selections, ie selecting

C:\
   | Documents and Settings:
       |  Administrator
            |  All Users
            |  Application Data             
            |  Desktop
            |  Documents
            |  My Pictures
            |  Favorites
            |  Start Menu
       |  Default User
       |  User1
       |  User2

You'll end up with

D:
 | temp
     | Documents and Settings
         |  All Users
           |  Desktop
           |  Documents
           |  Favorites
 
the tray icon could also be removed to reduce the clutter

cranioscopical:
Works perfectly here  >:(

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version