How to check if the user is on Mac or Windows ?
Hi everyone, in the JavaScript Tools Guide CC (http://download.macromedia.com/pub/developer/aftereffects/scripting/JavaScript-Tools-Guide-CC.pdf), on Chapter 3 : File System Access page 49 it says for the filter of function openDialog :
Optional. A filter that limits the types of files displayed in the dialog:
- In Windows, a filter expression, such as "JavaScript:*.jsx;All files:*.*"
- In Mac OS, a filter function that takes a File instance and returns true if the file
should be included in the display, false if it should not.
So how can I make the difference between widows and mac in my script ?
This is for the moment what I have. It works for windows but I don't know if it works for mac.
var filterFiles = function(file){
// IF WINDOWS
return "*.jsx;*.jsxinc";
// IF MAX
if (file.constructor.name == "Folder") { return true; }
writeLn(file.name);
if (file.name.slice(-4) == ".jsx" || file.name.slice(-7) == ".jsxinc") { return true; }
return false;
};
var files = File.openDialog("Choose a script", filter=this.filterFiles, multiSelect=this.multiSelect);
Thanks for your help
