Hi everybody! I wrote a short script which helps me saving docs in PNG or JPG more flexible. Most of this script is done and it works. One of my last tasks is to check, if the document I´m working woth has already been saved or not (I need the path to save it as PNG or JPG at the same place, where the original PSD Document is). But, if you´ve never saved the document before (because it has been created as a new one) there is also no path, only an error message. Now I want to awoid this error with give the user the opportunity to select a new Folder. Here ist the snippet: var myDoc = app.activeDocument; var dithArray = []; var Name = decodeURI(myDoc.name).replace(/\.[^\.]+$/, ''); //Prüfen, auf welcher Umgebung der Anwender arbeitet var os = $.os.toLowerCase().indexOf('mac') >= 0 ? "MAC": "WINDOWS"; switch(os){ case "MAC": var userName = $.getenv("USER") break; case "WINDOWS": var userName = $.getenv("USERNAME") break; } //Standard-Pfad generieren var defaultPath = "/Users/" + userName + "/Desktop"; //Prüfen, ob das Dokument bereits gespeichert worden ist if (myDoc.created == false){ var Path = decodeURI(myDoc.path); } else(Path = Folder.selectDialog ("Bitte einen Speicherort wählen!", defaultPath)) Line 17. is not proper like it is. Any idea? Thanks in advance
... View more