Creating Folder from Clipboard

Hi
am trying to make a button that selects a file of a particular extension(Only one file,JPG in my case),copy its name to clipboard and then create a folder from that name.

Then move files of A particular type(PNG in my case) to that folder.
The png and jpg files are in a single folder
ex.C:\Pictures\snapshot.jpg
C:\Pictures\1.png
C:\Pictures\2.png
C:\Pictures\3.png

So i want to move files 1,2,3.png to a new folder named Snapshot.This is how far i have gone

Select DESELECT ALLFILES ALLDIRS
Select *.jpg
Clipboard COPYNAMES=nopaths
CreateFolder FROMCLIPBOARD

but this isnt working i cant figure out why....if i manually select the file then it makes a new folder from clipboard but otherwise it just selects the file and doesnt make a new folder.
And any idea about how to do this

Select DESELECT ALLDIRS ALLFILES
Select .jpg
Clipboard COPYNAMES=nopaths REGEXP "(.
).(.*)" "\1"
Select DESELECT ALLDIRS ALLFILES
Select *.png
Copy MOVE TO HERE CreateFolder "{clip}"

yep i did it am getting better at scripting which isnt my forte...
anyhow these regular expressions are great.....i dont understand them much....just copied them from some other button :wink:

I really wanna learn regular expressions.....any gud place to start off??

can someone tell me a regular expression that i can use to rename a file to its folder name(And auto rename if more than one file)

I dont feel like starting a thread for such small thing.....but only if nudel doent mind :smiley:

It's nothing to do with whether Nudel minds or not, it's so that the forums remain a useful resource. There's nothing worse than searching a forum, finding a relevant post then having to wade through a pile of unrelated posts trying to find a solution to the problem.

Create new topics for new questions!