Using The Command Button

This is a newbie question, but I just can’t figure this out.

How can I set a command to open specific Corona SDK project (main.lua -file)?

Hi,

if you click the small arrow next to the Execute Command you can choose Edit Commands and add your command there :smile:

You can put whatever command you want there then.

Regards,
Ablu

There is actually a wiki article about using commands.

Thanks to all!

Yes that is exactly what I’ve tried, but I’m missing something. I used the following command that works when using terminal, but when I execute it using from Tiled, I get “The command failed to start”:

open -a /Applications/CoronaSDK/Corona\ Simulator.app /Users/user/Desktop/project/main.lua

Hi,

please check @bjorn’s link:

It says:

    On Mac, remember that Apps are folders, so you need to run the
    actual executable from within the Contents/MacOS folder:

    /Applications/TextEdit.app/Contents/MacOS/TextEdit %mapfile

That might be your issue. (No Mac here to test).

Regards,
Ablu

Thanks Ablu!

I’ve read the wiki and tried the following commands with MacOS:

open -a /Applications/CoronaSDK/Corona\ Simulator.app /Users/user/Desktop/project/main.lua
/Applications/CoronaSDK/Corona\ Simulator.app
/Applications/CoronaSDK/Corona\ Simulator.app/Contents/MacOS/Corona\ Simulator

Wiki doesnt say if “open” is needed. The first runs fine when using terminal. And if I want to execute a project file, I’m not sure do I have to write %path or what is the logic how executed program should find the file if it is not in the same folder.

I’m sorry. It must be my english, 'cause I think that I can’t tell you correctly what is my question. I think that if someone could just give me an another example how I can run a command that executes a specific application with specific file, like this (pseudo example: run /Apps/Corona-application /game/main.lua)

Sorry… I never used OS X. So I have no idea how to do this there…

Well, I noticed that the Corona project loads automatically on Corona Simulator if one of the project document is saved, I can manage without Tiled’s Command Button. In Tiled I just hit CTRL/CMD+E and voila :slight_smile:

Try /usr/bin/open instead of just open

I’m going to necro this this thread in case it helps someone. That path to Simulator.app is almost certainly the problem. It has a back slash and whitespace in it.

Try this instead (notice the quotes):

open -a "/Applications/CoronaSDK/Corona Simulator.app" /Users/user/Desktop/project/main.lua

Thanks @Seanba! I’ve now added a note about this to the Tiled documentation as well:

http://doc.mapeditor.org/manual/using-commands/