Script: auto create folder with file name ...

Get help with using AutoHotkey and its commands and hotkeys
conca
Posts: 6
Joined: 18 May 2016, 12:02

Script: auto create folder with file name ...

21 Sep 2017, 10:26

Hi all.
I'd like to create a script to automate this routine:
suppose I've a file named abcd.txt

I'd like to select this file with mouse (left click) and need a script that do:
- create a folder with the name of file (without extension .txt, .mov ecc)
- move the file into created folder (abcd.txt into abcd folder)
- move the folder into a specific path (ex. C:\Users\example\ecc)

It is possible to do ?

Thank u so mutch to anybody
Francesco
BoBo
Posts: 1604
Joined: 13 May 2014, 17:15

Re: Script: auto create folder with file name ...

21 Sep 2017, 11:08

I'd like to select this file with mouse (left click) and need a script that do: - Send ^c
- create a folder with the name of file (without extension .txt, .mov ecc) - SplitPath
- move the file into created folder (abcd.txt into abcd folder) - FileMove
- move the folder into a specific path (ex. C:\Users\example\ecc) - FileMoveDir

It is possible to do ? - Yes
conca
Posts: 6
Joined: 18 May 2016, 12:02

Re: Script: auto create folder with file name ...

21 Sep 2017, 11:58

tring to study all commands
conca
Posts: 6
Joined: 18 May 2016, 12:02

Re: Script: auto create folder with file name ...

25 Sep 2017, 02:54

FileCreateDir, C:\Users\Farmacia San Paolo\Documents\AHK\Prova
FileMove, C:\Users\Farmacia San Paolo\Documents\AHK\Prova.txt, C:\Users\Farmacia San Paolo\Documents\AHK\Prova\

This script work but I have to do a script that uses a mouse selction insted to file name:

I have this file : C:\Users\Farmacia San Paolo\Documents\AHK\Prova.txt
I'd like to select it with mouse and i need a script to:

FileCreateDir, C:\Users\Farmacia San Paolo\Documents\AHK\"selected file with no extention"
FileMove, C:\Users\Farmacia San Paolo\Documents\AHK\"file selected", C:\Users\Farmacia San Paolo\Documents\AHK\"selected file with no extention"\

how can I do it ?
I have to create a variable ?
please help me
thnx
BoBo
Posts: 1604
Joined: 13 May 2014, 17:15

Re: Script: auto create folder with file name ...

25 Sep 2017, 04:40

Code: [Select all] [Download] GeSHi © Codebox Plus

!F10:: ; press Alt + F10 once you've selected a file in Windows explorer
Send, ^c
MsgBox % "This is the path you've copied with pressing Alt + F10`n" ClipBoard
Return
Not tested. The variable ClipBoard contains the content of the :arrow: ClipBoard.
conca
Posts: 6
Joined: 18 May 2016, 12:02

Re: Script: auto create folder with file name ...

25 Sep 2017, 05:05

Code: [Select all] [Download] GeSHi © Codebox Plus

!F10:: ; press Alt + F10 once you've selected a file in Windows explorer
Send, ^c
MsgBox % "This is the path you've copied with pressing Alt + F10`n" ClipBoard
Return
FileCreateDir, C:\Users\Farmacia San Paolo\Documents\AHK\Prova
FileMove, ClipBoard, C:\Users\Farmacia San Paolo\Documents\AHK\Prova\


I have the message box that confirm that path file was copied
But the file in the path doesn't moove
User avatar
Capn Odin
Posts: 1273
Joined: 23 Feb 2016, 19:45
Location: Denmark

Re: Script: auto create folder with file name ...

25 Sep 2017, 05:19

Try

Code: [Select all] [Download] GeSHi © Codebox Plus

FileMove, % ClipBoard, C:\Users\Farmacia San Paolo\Documents\AHK\Prova\
Please excuse my spelling I am dyslexic.
conca
Posts: 6
Joined: 18 May 2016, 12:02

Re: Script: auto create folder with file name ...

25 Sep 2017, 05:44

Code: [Select all] [Download] GeSHi © Codebox Plus

!F10:: ; press Alt + F10 once you've selected a file in Windows explorer
Send, ^c
MsgBox % "This is the path you've copied with pressing Alt + F10`n" ClipBoard

FileCreateDir, C:\Users\Farmacia San Paolo\Documents\AHK\Prova
FileMove, % ClipBoard, C:\Users\Farmacia San Paolo\Documents\AHK\Prova\


Thanks It works !!

Now the next step:
we have fix the variable that is the path of the file: C:\Users\Farmacia San Paolo\Documents\AHK\Prova.txt
but

doesn't work
GEV
Posts: 624
Joined: 25 Feb 2014, 00:50

Re: Script: auto create folder with file name ...

25 Sep 2017, 06:13

Try this

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

conca
Posts: 6
Joined: 18 May 2016, 12:02

Re: Script: auto create folder with file name ...

25 Sep 2017, 06:55

Thank you so mutch to GEV
this is the final script:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Now All is perfect
thank u again and thanks to all people tried to help me

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], divanebaba and 45 guests