How to launch an application in cmd using Akelpad?

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 2
Joined: Sun Jun 08, 2025 5:27 pm

How to launch an application in cmd using Akelpad?

Post by aks2161989 »

I love the simple interface and the rich set of features of Akelpad. I am using this editor to write and compile simple programs in Java.

I have used the Hotkeys plugin to compile Java programs with this command

Code: Select all

Call("Log::Output", 1, `"javac" "%f"`, "%d")
Then I used the Hotkeys plugin to run the compiled Java program as follows

Code: Select all

Call("Log::Output", 1, `"java" "%f"`, "%d")
But some Java programs need user input, so I want to call these Java programs using cmd. I think the log::Output plugin cannot take user input.

How can I call programs from cmd from within Akelpad?

Any tips would be greatly appreciated!

DV
Offline
Posts: 1291
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Re: How to launch an application in cmd using Akelpad?

Post by DV »

You may try a script RunMe.js.
At first, you'll need to add a new command similar to:

Code: Select all

"java" :
  ":run_java(\"%d\", \"%n.%e\")",
to the `oCommands`.
And then add a new function:

Code: Select all

function run_java(fileDir, fileName, args) // 'args' is optional
{
  var cmd = (fileDir == "") ? fileName : fileDir + "\\" + fileName;
  cmd = buildCommandWithOptionalArgs("\"" + cmd + "\"", args);
  cmd = "cmd /C java " + cmd + " || pause";
  runCommand(cmd, "", 0); // do not capture output
}
Then you may specify the value of `args` either explicitly or by calling

Code: Select all

Call("Scripts::Main", 1, "RunMe.js", "1")
by means of the Hotkeys plugin.

Offline
Posts: 2
Joined: Sun Jun 08, 2025 5:27 pm

Re: How to launch an application in cmd using Akelpad?

Post by aks2161989 »

Thank you DV! I am now able to run progtams in cmd from within Akelpad. I used your script and everything works well

DV
Offline
Posts: 1291
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Re: How to launch an application in cmd using Akelpad?

Post by DV »

I've updated the script RunMe.js to include Java and apply the similar approach to the other languages.
Post Reply