VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I think the answer to this question is "No" but I'll ask in the hope that there might be a different answer.

I'm working on an application for OS X that will launch DOSBox from the command-line and run a DOS application, and will pass to the DOS application some command-line parameters that will be different every time the application is run, like this:

./DOSBox -exit cv.exe infile outfile -option

"infile" will be the name of a filename dropped on the application's icon.

I think this can't be done when launching DOSBox from the command line, and that I will need to do something else (perhaps write a conf file to disk each time the application is run, with an [autoexec.bat] section that includes the filenames).

But if it can be done from the command line, I'll be grateful to learn how to do it.

Reply 1 of 5, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

you can do it via applescript. When dosbox is running you can just have it (AppleScript) execute keystrokes...

(and Qbix way might be better for what you are looking for)

Last edited by Dominus on 2010-12-20, 15:51. Edited 1 time in total.

Reply 2 of 5, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

with drag and drop no.
with a commandline itself yes.
just check the readme on the commandline parameters of dosbox. (check -c)

Water flows down the stream
How to ask questions the smart way!

Reply 3 of 5, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

I wish there was a cross-platform way for DOSBox to detect when it is launched by drag-n-dropping something onto it, so that it could refuse to run.

I've even seen sites out there where they recommend that people use DOSBox in this way 🙁

Reply 4 of 5, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Qbix wrote:

with drag and drop no.
with a commandline itself yes.
just check the readme on the commandline parameters of dosbox. (check -c)

<slap on forehead> Of course, yes! I was so focused on the "name" parameter that I didn't think of doing this instead.

To HunterZ: Of course I am not foolish enough to try to run DOSBox by dropping a file on top of the DOSBox executable - I'm running it by dropping a file on an AppleScript application bundle that contains a copy of the DOSBox executable. This actually does work. The AppleScript can pass the name of the dropped file as a parameter to a unix command-line command.

Reply 5 of 5, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

drag drop works in most cases. There is nothing to detect as drag drop is simply (by the operating system)
translated to dosbox nameofdroppedexeuctable

however games that need more complex mount constructs don't work this way.

Water flows down the stream
How to ask questions the smart way!