SEE LAST POST
[SOLVED] 10/12/2013
Hi guys!
I'm Deos and I'm new to the forum, I'm using ahk for the last 6 months and it's my first experience with programming (after ahk I had some experience with python3 e a little of prompt batch for win).
Now, to the task.
As excercise I decided to write a batch-mover/renamer and I had no problem with it until I decided that had to decide (sorry for the word game ) what information to insert into the name of the renamed files. For example the file could be renamed as "A_LoopFileName + A_Index + something" as well as "something + A_Index". I tried to put the variable inside an Inputbox so that i can type into that %A_Index%_file.%A_LoopFileExt% but it is not working since it doesn't recalculate the variable.
This is the code, if u wanna give me an hand..
... InputBox, AddNam, How you wanna rename the files?, How you wanna rename the files? ;(UP) this is the variable I'd like to put to something like " A_Index . "_" A_LoopFileName "." . A_LoopFileExt " without the external quotes ... Loop, %SourcePattern%\%Fnam%.%Ftype%, %What%, %Recu% { VarNam := AddNam ;with these I try to refresh the variable ... FileMove, %A_LoopFileFullPath%, %DestinationFolder%\%VarNam%, %DoOverwrite% ;(UP) this is where it should work but it doesn't ... } ... returnThe fact is that if I put just one variable into the Inputbox, it is read and refresh but if I try to put more than one (as an expression) it is not working.
I'm tryin to go around this with a function, something like this
Join(sep, params*) { for index,param in params str .= param . sep return SubStr(str, 1, -StrLen(sep)) }that can format the variable in the correct sintax (but still needs a parser (to be added) to split literal string from variables).
EDIT
edited the whole post to make it more readable and less time comsuming
Thank You for your time!
Edited by bigdeoz, 10 December 2013 - 11:30 AM.