javascript console

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 2 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
kpantermd
Posts: 3
Last visit: Thu Jul 11, 2024 6:42 pm

javascript console

Post 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.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: javascript console

Post 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
kpantermd
Posts: 3
Last visit: Thu Jul 11, 2024 6:42 pm

Re: javascript console

Post 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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: javascript console

Post 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
kpantermd
Posts: 3
Last visit: Thu Jul 11, 2024 6:42 pm

Re: javascript console

Post 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
This topic is 2 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked