DonationCoder.com Software > Post New Requests Here
IDEA: Desktop Teleporter
skrommel:
:) Any one care to test this script? It's called CleanDesk, but you can edit the settings to make rules to move any files and folders from any folders, and either ignore, move or rename them.
Please report any bugs, and I'll give it a GUI tomorrow.
Skrommel
Spoiler
--- ---;CleanDesk.ahk
; Moves files and folders from the Desktop (or any other folder) to another folder
; Make rules for certain file types or file names to be ignored, replaced or renamed
; Save to file and use AutoHotkey from www.autohotkey.com to run it
;Skrommel @ 2006
;Settings
timer=2000 ;How often to check for new files in ms
status=0 ;0=Hide 1=Show Traytip of files being moved
1source=%A_Desktop% ;Use variables like %A_Desktop%, %A_ScriptDir%, %A_MyDocuments%, %A_StartMenu%
1target=%A_Desktop%\Desktop ; %A_AppData%, %A_ProgramFiles%, %A_WinDir%
1files=* ;Files to move, supports wildcards * and ?
1ignore=jpg,jpeg ;Filenames and extensions to ignore, separated by comma. No wildcards!
1replace=2 ;0=No 1=Yes 2=Ask 3=Rename
2source=%A_DesktopCommon% ;%A_DesktopCommon%, %A_StartMenuCommon%, %A_ProgramsCommon%
2target=%A_DesktopCommon%\Desktop ;
2files=* ;Files to move, supports wildcards * and ?
2ignore= ;Filenames and extensions to ignore
2replace=2 ;0=No 1=Yes 2=Ask 3=Rename
3source=%A_Desktop%
3target=%A_Desktop%\Desktop
3files=*.jp*g ;Only jpg and jpeg images
3ignore=
3replace=3 ;Rename if same name
;Program
#Persistent
#SingleInstance,Force
SetTimer,TIMER,%timer%
Return
TIMER:
SetTimer,TIMER,%timer%,Off
Loop,9
{
counter:=A_Index
source:=%counter%source
target:=%counter%target
files:=%counter%files
ignore:=%counter%ignore
replace:=%counter%replace
If source=
Continue
Gosub,CLEAN
}
SetTimer,TIMER,%timer%,On
Return
CLEAN:
Loop,%source%\%files%,1,0
{
ext:=A_LoopFileExt
name:=A_LoopFileName
longpath:=A_LoopFileLongPath
If ext In %ignore%
Continue
If name In %ignore%
Continue
If longpath In %ignore%
Continue
If status=1
TrayTip,%applicationname%,%longpath%
FileGetAttrib,attrib,%longpath%
IfInString,attrib,D
Gosub,FOLDER
Else
Gosub,FILE
}
Return
FOLDER:
FileCreateDir,%target%
If replace=0
{
FileMoveDir,%longpath%,%target%,R
If ErrorLevel=1
FileMoveDir,%longpath%,%target%,0
}
Else
If replace=1
{
FileMoveDir,%longpath%,%target%,R
If ErrorLevel=1
FileMoveDir,%longpath%,%target%,2
}
Else
If replace=2
{
IfExist,%target%\%name%
{
MsgBox,3,%applicationname%,Replace folder %target%\%name% ?
IfMsgBox,Yes
FileMoveDir,%longpath%,%target%,1
IfMsgBox,No
{
ignore=%ignore%,%longpath%
%counter%ignore=%ignore%
}
IfMsgBox,Cancel
ExitApp
}
Else
{
FileMoveDir,%longpath%,%target%,R ;Doesn't work !?
If ErrorLevel=1
FileMoveDir,%longpath%,%target%,1 ;Should really be 0 !?
}
}
Else
If replace=3
{
IfExist,%target%\%name%
{
FileMoveDir,%longpath%,%target%\%name%-%A_Now%.%ext%,R
If ErrorLevel=1
FileMoveDir,%longpath%,%target%\%name%-%A_Now%.%ext%,0
}
Else
{
FileMoveDir,%longpath%,%target%,R
If ErrorLevel=1
FileMoveDir,%longpath%,%target%,0
}
}
Return
FILE:
If replace In 0,1
FileMove,%longpath%,%target%,%replace%
Else
If replace=2
{
IfExist,%target%\%name%
{
MsgBox,3,%applicationname%,Replace file %target%\%name% ?
IfMsgBox,Yes
FileMove,%longpath%,%target%,1
IfMsgBox,No
{
ignore=%ignore%,%longpath%
%counter%ignore=%ignore%
}
IfMsgBox,Cancel
ExitApp
}
Else
FileMove,%longpath%,%target%,0
}
Else
If replace=3
{
IfExist,%target%\%name%
FileMove,%longpath%,%target%\%name%-%A_Now%.%ext%,0
Else
FileMove,%longpath%,%target%,0
}
Return
reko100:
hi tchikien,
I have download your teleporter and from the gui, not sure how it works :tellme:....in need of your help file...Thanks.
Joe
lanux128:
since tchikien is busy with the program, i'll put a small explanation. i think, the program's quite intuitive.
1st you have to specify the output folder (Fig. 1).
Fig. 1
then leave the program running. when you drop a file onto your desktop, a message will appear (Fig. 2) prompting if you want to save a note as well. click 'don't save note' to continue without saving a note.
Fig. 2
btw, the prompt to write a note can also be disabled. (Fig. 3)
Fig. 3
reko100:
ok, that means if i didnt put in any exclude list, it will teleport out all the files....understood!
Joe
tchikien:
It will teleport out all the files, except files in used by other programs.
Btw, I will not create a help file. If anyone has question, please post it here so i will answer if i have time. Or maybe other member can help you here.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version