gavioto / stexbar

Automatically exported from code.google.com/p/stexbar
0 stars 1 forks source link

"enfolder" AutoHotKey script submission #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
/*
Takes the items in the arguments and packages them in a folder for you.
*/

items =
name =

Loop %0%    ;build a suggestion for the folder path.  better suggestions could
be made, but I never got around to it.
{

    item := %A_Index%
    SplitPath, item, name, dir, ext, name_no_ext, drive
    break
}
;msgbox, %item%--%name%--%dir%--%ext%--%name_no_ext%--%drive%
InputBox,fname,Folder Name?, Please enter the folder name.  The path will
be relative to "%dir%" unless a full path is given,,,,,,,,%name_no_ext% 
;first item's name as the suggestion

if ErrorLevel
    return

;no need for trailing slashes
StringRight test, fname, 1
if test = \
    StringTrimRight, fname, fname, 1

;check if user provided path is relative or not
IfInString fname, :
    destination = %fname%
else
    destination = %dir%\%fname%

FileCreateDir %destination%

if ErrorLevel
{
    Msgbox there was some error in creating the folder "%dir%\%fname%"
    return
}

Loop %0%
{
    item := %A_Index%
    FileGetAttrib, Attributes, %item%
    IfInString, Attributes, D
    {
        StringGetPos, break,item,\,R1
        break:=break+1
        StringTrimLeft, tail, item, %break%
        FileCreateDir %destination%\%tail%
        FileMoveDir %item%, %destination%\%tail%, 2
    }
    else
        FileMove %item%, %destination%  

    if ErrorLevel
        MsgBox error moving %item%                  ;meh
}
QUIT:
ExitApp

Original issue reported on code.google.com by kijoshua...@gmail.com on 2 Aug 2008 at 3:16

GoogleCodeExporter commented 9 years ago

Original comment by tortoisesvn on 2 Aug 2008 at 3:38

GoogleCodeExporter commented 9 years ago
what's the filename this script should be saved under (file extension *.ahk ?)?
I guess you have to have AutoHotKey installed?

Original comment by tortoisesvn on 2 Aug 2008 at 4:20

GoogleCodeExporter commented 9 years ago
Actually, I'll compile them all and attach them to new comments.  Then they'll 
be
regular .exe files.

Otherwise, yes, they would have been .ahk files that would need AutoHotKey to 
run.

Original comment by kijoshua...@gmail.com on 2 Aug 2008 at 4:32

GoogleCodeExporter commented 9 years ago
Compiled version (doesn't require AutoHotKey to run)

Original comment by kijoshua...@gmail.com on 2 Aug 2008 at 4:35

Attachments:

GoogleCodeExporter commented 9 years ago
Could you attach the ahk files too? I will then add both to our contrib folder 
- if
someone already has autohotkey installed, they might rather use the scripts 
instead
of the exe files.

Also, I don't know if it's possible to attach exe files, you may have to zip 
them
first (never tried to attach them to a comment, but I would assume that Google 
has
some restrictions on content to upload here).

Original comment by tortoisesvn on 2 Aug 2008 at 4:37

GoogleCodeExporter commented 9 years ago
Also, could you add a comment to the files on how to configure the commandline 
in
StExBar to use them?
For example, I did that for tha 'attrib.js' file:
http://code.google.com/p/stexbar/source/browse/trunk/StExBar/contrib/attrib.js

We want to make it as easy as possible for people to use those scripts :)

Original comment by tortoisesvn on 2 Aug 2008 at 4:39

GoogleCodeExporter commented 9 years ago
Here they all are (I leave for a second and look what happens.  Your really 
quick in
dealing with all this!).  

These are new versions containing better comments and support for %selafile.  
Both
source and compiled versions of the five scripts I had laying around.  I'm 
pretty
sure they work fine, but I'll go test them again with the new version of 
StExBar just
to make sure.  %selufile should work just the same as well.

Original comment by kijoshua...@gmail.com on 2 Aug 2008 at 5:28

Attachments:

GoogleCodeExporter commented 9 years ago
It may take me a while to compile the source (still downloading some prereqs).

But I did a quick test using a temporary file I created myself, and everything 
worked
as expected.

I'm attaching a new set, because I forgot to put my name and a timestamp in the 
source...

Thanks again for providing a much better way for me to put these scripts to 
good use
(among other things)!  

I really hope some more people start contributing.  I could post a notice in the
AutoHotKey forums about this program if you'd like (or you could do it to make 
sure
things get said the way you want).  I'm sure some of those scripters already 
have
great ideas but are just waiting for a way to implement them.

Original comment by kijoshua...@gmail.com on 2 Aug 2008 at 5:52

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks a lot!!
Committed your scripts in r165 - they're now available in the contrib folder:
http://stexbar.googlecode.com/svn/trunk/StExBar/contrib/

Original comment by tortoisesvn on 2 Aug 2008 at 6:42