![Photoshop will not open files Photoshop will not open files](/uploads/1/2/5/5/125500873/943605480.jpg)
In this Photoshop tutorial, we'll learn all about the new Start screen and Recent Files panel that were first introduced to Photoshop CC in the November 2015 Creative Cloud updates. No matter what we plan on doing with Photoshop, the first step is always the same; we either open an existing image or document to work on, or we create a brand new document from scratch.
Hi guys,I think this is a very simple problem but I've experimented with FindNextFile and can't seem to work it out.I have a folder which has Excel files, a new file is put in their daily. I want my autoIT script to open up the most recently created file (when a button is pressed in a GUI, although this seems the easy bit to me!)I assume something can be done through the FileGetTime Function but I'm not sure how to get my script to run through the files in the folder doing this???Any help would be muhc appreciated!!ThanksMark. Hi guys,I think this is a very simple problem but I've experimented with FindNextFile and can't seem to work it out.I have a folder which has Excel files, a new file is put in their daily. I have been on this way toooooo longfileGetTime doesnt seem to work on xls. And some other files like.doc$folder = @MyDocumentsDir$search = FileFindFirstFile($folder & '.xls')$now = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC$oldest = 'While 1$file = FileFindNextFile($search)if @error Then ExitLoopif FileGetTime($folder & $file,0,1) #Include #Include $Location = @MyDocumentsDir$FileList=FileListToArray($Location, '.doc', 1)ArrayDisplay($FileList,'My Documents')If (Not IsArray($FileList)) and (@Error=1) ThenMsgBox (0,','No FilesFolders Found.' )ExitEndIf$newest = FileGetTime($FileList1,0,1)MsgBox(64,'First File', 'File: ' & $FileList1 & @CRLF & 'Info: ' & $newest)$newname = '(None)'For $x = 2 to $FileList0if FileGetTime($FileList$x,0,1) $newest Then$newest = FileGetTime($FileList$x,0,1)$newname = $FileList$x;MsgBox(64,'Newest', $newest)EndIfNextMsgBox(64,'Newest',$newname & ' is your most recent file ' & @CRLF & 'created: ' & $newest)?????8). I have been on this way toooooo longfileGetTime doesnt seem to work on xls.
And some other files like.doc$folder = @MyDocumentsDir$search = FileFindFirstFile($folder & '.xls')$now = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC$oldest = 'While 1$file = FileFindNextFile($search)if @error Then ExitLoopif FileGetTime($folder & $file,0,1) #Include #Include $Location = @MyDocumentsDir$FileList=FileListToArray($Location, '.doc', 1)ArrayDisplay($FileList,'My Documents')If (Not IsArray($FileList)) and (@Error=1) ThenMsgBox (0,','No FilesFolders Found.' )ExitEndIf$newest = FileGetTime($FileList1,0,1)MsgBox(64,'First File', 'File: ' & $FileList1 & @CRLF & 'Info: ' & $newest)$newname = '(None)'For $x = 2 to $FileList0if FileGetTime($FileList$x,0,1) $newest Then$newest = FileGetTime($FileList$x,0,1)$newname = $FileList$x;MsgBox(64,'Newest', $newest)EndIfNextMsgBox(64,'Newest',$newname & ' is your most recent file ' & @CRLF & 'created: ' & $newest)?????8)it worked for me, except i messed up my code and grabbed the oldest file instead of the newest, but i tested my code and it does work to find the oldest. One thing that i had to do to get a result was add the path $folder to the FileGetTime, i've tried doing it with FileGetLongName($file) but that didn't work. Hey Cameron,The script worked a treat for me except it finds the oldest file. I've looked at it and tried to work out how I can alter it so that its the most recently created file that I get but I don't seem to be able to manipulate it that way.any ideas???Thanks for your response Valuater.I tried your script but cannot seem to get it to work, I think its because of my inadequacies using the Array function (its something I've never used before!) So it might be looking at the wrong file paths or something which could be why its failing.Any help much appreciatedCheersMark. Hey Cameron,The script worked a treat for me except it finds the oldest file. I've looked at it and tried to work out how I can alter it so that its the most recently created file that I get but I don't seem to be able to manipulate it that way.any ideas???Thanks for your response Valuater.I tried your script but cannot seem to get it to work, I think its because of my inadequacies using the Array function (its something I've never used before!) So it might be looking at the wrong file paths or something which could be why its failing.Any help much appreciatedCheersMarkjust switch the, and change the assignment for $now to 0.
![The The](http://morris-photographics.com/photoshop/scripts/images/open-recent.png)
That way when it's called, the date of the first file will be compared to 0, will be greater, and each newer file after that will be saved to the $oldest (sorry the variable names will be all confused since i made it initially to find the oldest) and will be output at the end. Expand collapse popup $sLatestFileCreated = FileVersion (, '.xlsx', 1, ) ( 64, 'Latest Created File Version', $sLatestFileCreated ) $aLatestFileCreated = FileVersion (, '.xlsx', 1, ) ( $aLatestFileCreated ); #FUNCTION# ; Name.: FileVersion; Description.:; Syntax.: FileVersion($sFilePath, $sMask = '.' , $iFlag = 0, $bFormat = True); Parameters.: $sFilePath - Folder Path to Search; $sMask - optional File Mask.