@ yume
Well, we're getting there!
But this code has some issues...
First, it doesn't actually retrieve the last created jpg file in that directory. (I changed E:\testimages to E:\Desktop). I created some image files and the last one indeed was retrieved when I first executed the code. Then, I grabbed one of the files and copied it to the same folder (the own Destkop itself) and executed again. The previous file again was returned, but not the copy, which was, obviously, first created.
SEcond: what if I'd like to extend this to all filetypes, not just .jpg? I replaced
Code:
Loop,%ImageDir%*.jpg
with
Code:
Loop,%ImageDir%*.*
but I had no luck.
Then, I tried changing the .jpg to .txt. Didn't work well... it retrieved an old file; when I crated a new file just to text, the same previous old file was retrieved again. Why?
Quote:
...wouldn't it be better to create a folder for "new pix", that is only a temp holding place for new pix, until this Hotkey deals with them & after it's done with them it moves them to a Pix folder (or to the Desktop, if you like it full of Pix)...
I skimmed a bit, so I may have missed it...why can't you specify the filename to IrFanView?...but anyway I think a dedicated dir for "new pix" is best, it can handle any amount of new pix, loop over that folder, every file is a new pic to "deal with", don't have to find the newest...
No I don't like the desktop full of pix!
Creating a temp specialized dir could be fine, but moving the file afterwards could be chaotic because most of them have know destination:recycle bin and others I can move manually to the right dir.
The idea of it being the desktop is good because
1- the file won't stay for longer there;
2- it is the default save dir for IrFanView and downloaded files from Firefox.
But I'd like, if possible, for this to be broader; could extend to all filetypes; for example: I just typed my resumé in Microsoft Word, and saved it in the desktop. I wanna e-mail my potential employer. Then I open Firefox with the webmail, or even Thunderbird, and, when I attach the file, I don't have to browse for it since I know that it was the last to be created so I would just type the magic hotstring to expand to its path, like E:\Desktop\My Resumé.doc...