Is there a way to run JavaScript code inside Aptana Studio 3 IDE?
Asked Answered
P

5

10

I created a Test.js file and wrote two lines of JS code in it:

var a = 5;
console.log("The result is = " + a);

The output should be:

"The result is = 5"

Is there a way I can see this in Aptana Scripting console, instead of integrating the JS code in a HTML file and saving/refreshing it?

Can any other IDE, say Netbeans help, if not Aptana?

Any advise would be highly appreciated.

Regards

Roy

Patricia answered 2/5, 2012 at 16:54 Comment(1)
I often write code snippets in browser consoles and piece larger functions/objects together that way. Chrome's now has auto-complete.Phi
T
1

I think that it would be best if you give Node.js a try. This way, you get to call node test.js on a console window and see the result.

Thermae answered 22/5, 2012 at 23:35 Comment(0)
P
1

I'm pretty sure that console is meant for viewing the output of Aptana's Ruby-based commands (installed under the Commands menu). It might be possible to follow the instructions here: http://www.chromium.org/for-testers/enable-logging and then tail the resulting log file in a Terminal panel (not the same as a console window).

Perfectionist answered 25/5, 2012 at 2:47 Comment(0)
S
0

I'm afraid it is not possible.

But What I did was to setup a simple workbench.html file, where in the header I put

[...]
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="js/myJsFile.js"></script>

and then modified the myJsFile.js and saved it.

Another very intersting possibility is given by http://www.developer.nokia.com/Community/Wiki/Aptana_WRT_Plugin:_Displaying_log_messages_in_Output_console

just check it

Sicyon answered 26/5, 2012 at 11:2 Comment(0)
P
0

It's not exactly what you asked, but it might point you in the right direction. There's a project called EclipseMonkey ... I'm not sure the status. Here's a working (?) example. Your mileage will vary. http://blogs.edgehill.ac.uk/webservices/2008/10/16/aptana-outline-auto-expansion-monkeyed/

Perfectionist answered 27/5, 2012 at 0:59 Comment(0)
A
0

What you can do is you can download node.js from node.js, download the package and follow the installation instructions on the screen.

If using a Windows, the node.js package comes with its own interactive command prompt which you can open. To run a js file on windows, open the windows command prompt, type in node, then the name of your file e.g. test.js. Node.js should run your file.

If using a Mac, the node.js package runs through the terminal application on the mac. To run a file, type in node, then the name of your file e.g. test.js, node.js should run the file.

Aptana Studio 3 has the ability to open the terminal inside the IDE itself. Save your file in Aptana Studio and follow the instructions to run a file on the mac.

By the way, keep your files labelled in lowercase letters, I tried using Uppercase for the first letter and it did not work.

Hope that helps.

Aram answered 21/7, 2013 at 5:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.