How can i use the value from get file/folder date as a REAL date-variable???
I want to get the date for a file and the use (via vb-script) dateadd(“d”,filedate,now) to look if the file is older then 10 days.
Thx
Hi Elvira,
It’s probably less fuss to just use VBScript for all of the functionality, something like this:
Set oFSO = CreateObject(“Scripting.FileSystemObject”)
Set oFile = oFSO.GetFile(“C:\Temp\MysourceFile”)
If oFile.DateModified < Date - 10 Then
…
and so on.
Alternatively, if you’re using FinalBuilder Professional then you can use the File Dependency action. Set the action “date to compare” to “use specific date” then put the following onto the BeforeAction event:
Action.StaticDate = Now - 10
(This sets the static date/time to compare to 10 days before the current date/time.)
Hth.
Regards,
Angus
OK,
i use the vbscript to get the date, but i thought to change it to an action (to better read the script)…
No real problem for me, but WHAT ist the get file/date action for, when i can´t use the return value???
Hi Elvira,
I see what you mean about using a single action. You can still use a Run Script action, put all the script code into the OnExecute event, and rename the action to reflect the job that it’s doing. Would that help?
The get file date action will retrieve the date as a formatted string, which is useful if you want to use it in that format. In order to compare it, though, you need to write it back to a DATE/CDate/floating point Date type, which requires re-parsing the string. I’ll look into adding a script event to the “get file date” action which has the date object as a parameter.
Hth.
- Angus