Copy link to clipboard
Copied
In JSX script, I can use file.modified gets the modified date of the file, but displays null on MacOS
Copy link to clipboard
Copied
my jsx like this:
#target "illustrator"
#targetengine "main"
var myFolder = File("~/Desktop");
var myFiles = new File(myFolder.getFiles("test.ai"));
var myFileDate = myFiles.modified;
alert(myFileDate);
Copy link to clipboard
Copied
Bonjour,
Le chemin est bien /Users/Desktop ?
var myFolder = "~/Desktop";
var myFiles = new File(myFolder+"/test.ai");
alert(myFiles.exists)
var myFileDate = myFiles.modified;
alert(myFileDate);
var myFileDate = myFiles.created;
alert(myFileDate);
Copy link to clipboard
Copied
It works for me (Windows). If you're getting "null", then the file is not being accessed. Try the full path?
Copy link to clipboard
Copied
It works in Windows,but getting "null" in macos
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I too am getting this issue, after trying a lot of things and trying to get an answer through searching online, I have arrived here.
I have code that works for InDesign but errors with Illustrator for getting a modified date for a file
Full File Path obscured, but catch never fires off anyways as the $.fileName returns correctly
try{
var CurrentScript = File($.fileName)
} catch (err) {
var CurrentScript = File("/Users/Folders.../ScriptName.jsx")
}
alert(CurrentScript.exists + "\n" + CurrentScript.modified)
Copy link to clipboard
Copied
Pretty sure the .modified() method is just broken on the Mac for whatever reason. We discussed it here as well.