Copy link to clipboard
Copied
Is there a console or log for output from script events? I tried making a function, which executes an alert correctly, but doesn't create a new document. I can't find any way to see if this syntax is wrong or the command is just outdated.
In the code below, for example, I see the alert message, but no new document. I don't see anyway to see what's wrong with it and I pulled that line straight from the photoshop scripting guide.
var createDocument = function() {
alert("creating new doc!");
app.documents.add(2,4);
};
IMHO I do not think so. (I do not need that.)
Maybe I understand you wrong only.
The only thing you could do - show own messages they even close again by itself.
Something like this:
...// CreateNewDocAndShowMessage.jsx
// http://forums.adobe.com/thread/1237214?tstart=0
// regards pixxxelschubser
var Call;
createDocument ();
function createDocument () {
Call = "creating new doc!";
CallFunction ();
app.documents.add (40,40);
}
function CallFunction () {
win = new Window ("palette");
win.som
Copy link to clipboard
Copied
Your alert is a modal dialog and will stop the rest of the script executing until its dismissed…
app.documents.add(2,4);
works just fine…
Copy link to clipboard
Copied
Try this:
var NewDocument;
createDocument ();
alert (NewDocument);
function createDocument () {
alert("creating new doc!");
app.documents.add (40,40);
NewDocument = app.activeDocument;
return NewDocument;
}
Have fun
Copy link to clipboard
Copied
Thanks, guys. I appreciate the feedback. I realize alert is a blocking call and creates a modal window. I'll look into why it isn't working based on your suggestions, but my bigger question was the existence of a javascript console/log so I could see ANY errors that happen in the future. Thanks.
Copy link to clipboard
Copied
Why you don't use $.writeln instead?
var NewDocument;
createDocument ();
$.writeln (NewDocument);
function createDocument () {
$.writeln ("creating new doc!");
app.documents.add (40,40);
NewDocument = app.activeDocument;
return NewDocument;
}
Copy link to clipboard
Copied
I can certainly give that a try! Where is that outputted to?
Copy link to clipboard
Copied
Hmmh?
strattonbrazil wrote:
… but my bigger question was the existence of a javascript console …
The output you get in ESTK (ExtendScript Toolkit) in the javascript console.
Copy link to clipboard
Copied
So you only get output if you're running your script through ESTK? There's no script output in photoshop itself like Maya, Mudbox, Mari, 3DS Max, Houdini, etc. where you can see what's being run and where it's erroring?
I'm running this inside of a panel created by Adobe Configurator.
Copy link to clipboard
Copied
IMHO I do not think so. (I do not need that.)
Maybe I understand you wrong only.
The only thing you could do - show own messages they even close again by itself.
Something like this:
// CreateNewDocAndShowMessage.jsx
// http://forums.adobe.com/thread/1237214?tstart=0
// regards pixxxelschubser
var Call;
createDocument ();
function createDocument () {
Call = "creating new doc!";
CallFunction ();
app.documents.add (40,40);
}
function CallFunction () {
win = new Window ("palette");
win.someMessage= win.add ("statictext", undefined, Call);
win.show();
$.sleep(1500);
win.close();
}
Copy link to clipboard
Copied
Everything I've tried seems to have to effect besides showing the actual alert messages. It's like panels' javascript don't have access to the documents or something. Neither one of these commands seems to do anything and it's frustrating any progress without knowing what the problem is.
app.documents.add (40,40);
Copy link to clipboard
Copied
It's only a wrong syntax.
version 1:
app.documents.add (40,40);
var a = documents.length -1;
app.documents.artLayers.add();
version 2:
app.documents.add (40,40);
activeDocument.artLayers.add();
By the way: the "footer" in ESTK shows you mostly the reason of mistakes.
Have fun
Copy link to clipboard
Copied
Can you work on configurator panels in ESTK?
Copy link to clipboard
Copied
Because documents.add() returns a reference to the newly created document you could do this.
var a = app.documents.add (40,40);
a.artLayers.add();
Copy link to clipboard
Copied
Has anyone been able to create a document from a Adobe-configurator-created panel HTML event? I guess that's a bigger question. If no one else can do that, I'm wasting my time with the output. That seems to be my experience, but I don't know why scripts in html wouldn't have access to the app besides some strange namespacing issue or running in a separate VM or something.
Copy link to clipboard
Copied
@Michael L Hale,
This is definitely correct. But I do not even know what the TO really wants.
@strattonbrazil
HTML event???
I think my English is too bad to follow you. Also, I can not use the Adobe-configurator or panels with CS3
I'm out then
Copy link to clipboard
Copied
Hrmm, well, besides ESTK the answer appears to be no. Thanks, guys.
Copy link to clipboard
Copied
This is a random comment and not intended to be offensive, but you used "IMHO" a couple times incorrectly and you might want to know. IMHO or "in my humble opinion" refers to personal opinion and not a statement of fact. This person is asking for some sort of console output instruction, so if you don't know the fact use AFAIK - "As far as I know". So you could say "AFAIK there isn't a better way to get debug messages in photoshop directly, IMHO you don't them and should do ~whatever else~ instead.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now