Page 1 of 1

javascript console

Posted: Sun Mar 20, 2022 9:47 am
by kpantermd
Why is console undefined by Javascript and Jscript? Granted I am a total rookie, I have used console.log() in many other programming environments. What am I doing wrong? Thanks.

Re: javascript console

Posted: Mon Mar 21, 2022 7:47 pm
by jvierra
JavaScript does not have a "console". It is a web-oriented language used in browsers. Browsers do not have consoles.

Web pages have a pseudo-console accessibly by "console.log()" used mostly to send debug messages to the browser.

To learn about JavaScript output methods see the following: https://www.w3schools.com/js/js_output.asp

Re: javascript console

Posted: Tue Mar 22, 2022 1:24 pm
by kpantermd
Jvierra,

First and foremost, thank you for your reply.

Secondly, I am at a loss. I am trying to learn javascript so I can write scripts to run withing Adobe Illustrator. I am not interested in producing any programs / applications to run outside of Illustrator. It has been a long time since I have written any code. I use to program CDC 6800 and PDP 8 machines in assembly back when the dead sea was just a little sick. What I am asking is how to "output" something from PrimalScript via javascript. The following has failed:

console.log("Test");
window.alert("Test");
alert("Test");
document.write("Test");

This tells me that I have a misunderstand of javascript. I am treating it like an old programming language. I simply want to develop the Illustrator scripts - I have not had the time to learn what must be the fundamentals of javascript. So, it is time to bite the bullet. Can you kindly recommend a tutorial / training / course for an old fool that will easily let him understand javascripting?

Thank you again for all your assistance
Over and out, Kent

Re: javascript console

Posted: Tue Mar 22, 2022 3:08 pm
by jvierra
You have to ask in the Adobe forum. Adobe uses special API calls that are not part of JavaScript. You might start by reading the Adobe scripting manual.

https://ai-scripting.docsforadobe.dev/s ... cript.html

Re: javascript console

Posted: Wed Mar 23, 2022 12:07 am
by kpantermd
Yes, I have the Adobe Manuel but I thought first I would try to develop a molecule of understanding before diving into the book. As I said, guess it is time to bite the bullet. And with my luck, it will go off in my head!

Thanks - off to Adobe. You have been wonderful!

Over and out, Kent