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
Script: auto create folder with file name ...
Re: Script: auto create folder with file name ...
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
Re: Script: auto create folder with file name ...
tring to study all commands
Re: Script: auto create folder with file name ...
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
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
Re: Script: auto create folder with file name ...
Code: Select all
!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
Re: Script: auto create folder with file name ...
Code: Select all
!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\
But the file in the path doesn't moove
Re: Script: auto create folder with file name ...
Try
Code: Select all
FileMove, % ClipBoard, C:\Users\Farmacia San Paolo\Documents\AHK\Prova\
Please excuse my spelling I am dyslexic.
Re: Script: auto create folder with file name ...
Code: Select all
!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\
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
Code: Select all
FileCreateDir, % ClipBoard
Re: Script: auto create folder with file name ...
Try this
Code: Select all
#If WinActive("ahk_class CabinetWClass") ; explorer
!F10:: ; press Alt + F10 once you've selected a file in Windows explorer
ClipSaved := ClipboardAll ; save the entire clipboard to the variable ClipSaved
clipboard := "" ; empty the clipboard (start off empty to allow ClipWait to detect when the data has arrived)
Send, ^c ; copy the selected file
ClipWait, 2 ; wait for the clipboard to contain data.
if (!ErrorLevel) ; If NOT ErrorLevel, ClipWait found data on the clipboard
{
clipboard = %clipboard% ; convert clipboard to plain text (= copy the path of the selected file)
Sleep, 300 ; needs a little time to convert the clipboard
MsgBox, 0, , %clipboard% ,2 ; display the path, 2 sec
SplitPath, clipboard, name, dir, ext, name_no_ext, drive ; get the name of the selected file (without extension)
FileCreateDir, C:\Users\Farmacia San Paolo\Documents\AHK\%name_no_ext% ; create a folder with the name of file
FileMove, %clipboard%, C:\Users\Farmacia San Paolo\Documents\AHK\%name_no_ext%\ ;, 0 = (default) do not overwrite existing files
}
else
MsgBox, No file selected
Sleep 300
clipboard := ClipSaved ; restore original clipboard
return
#if
Re: Script: auto create folder with file name ...
Thank you so mutch to GEV
this is the final script:
Now All is perfect
thank u again and thanks to all people tried to help me
this is the final script:
Code: Select all
#If WinActive("ahk_class CabinetWClass") ; explorer
!F10:: ; press Alt + F10 once you've selected a file in Windows explorer
ClipSaved := ClipboardAll ; save the entire clipboard to the variable ClipSaved
clipboard := "" ; empty the clipboard (start off empty to allow ClipWait to detect when the data has arrived)
Send, ^c ; copy the selected file
ClipWait, 2 ; wait for the clipboard to contain data.
if (!ErrorLevel) ; If NOT ErrorLevel, ClipWait found data on the clipboard
{
clipboard = %clipboard% ; convert clipboard to plain text (= copy the path of the selected file)
Sleep, 300 ; needs a little time to convert the clipboard
MsgBox, 0, , %clipboard% ,2 ; display the path, 2 sec
SplitPath, clipboard, name, dir, ext, name_no_ext, drive ; get the name of the selected file (without extension)
FileCreateDir, D:\Download\Completi\%name_no_ext% ; create a folder with the name of file
FileMove, %clipboard%, D:\Download\Completi\%name_no_ext% ;, 0 = (default) do not overwrite existing files
FileMoveDir, D:\Download\Completi\%name_no_ext%, D:\Download\Appo Film\%name_no_ext%
}
else
MsgBox, No file selected
Sleep 300
clipboard := ClipSaved ; restore original clipboard
return
#if
thank u again and thanks to all people tried to help me