Excuting "Commands"

I realized that there is a “execute a command” action, but I am unsure how to use it and to tell it waht I want it to do.

Let’s say I want to open up a file using a command.

Is it possible, and if it is, what do I write to tell it to open the file?

That action let you execute OS commands, as the commands used in the Windows CMD or in a Linux console.
For example, if your .gdg file is named “Test.gdg”, you can do it:
On Windows:

Conditions: At the beginning of the scene Actions: Execute "notepad Test.gdg"
On Ubuntu:

Conditions: At the beginning of the scene Actions: Execute "gedit Test.gdg"
On Mac:

//TODO, I have not a Mac ;)

These actions will open the .gdg file in the built-in text editor, you doesn’t have to specify a full file path because the current directory is the .gdg file directory itself :slight_smile:

Awesome! Thanks!

…But…what’s the difference between opening a file and executing a command?

Execute a command do what I said, execute terminal commands from GD, so other things can be done besides open files, as run programs, create files… delete files? :smiling_imp: . Open a file (the other action in the same group as execute command) open a file in the browser, or a URL, useful to open the game’s official page :wink:

how to do in gdevelop 5?

Please do not bump a 4 year old thread about a completely different platform.

This action doesn’t exist as is in GD5. You are welcome to make a new post with a description of what you are trying to do.

Closing this thread.

1 Like