3.3 Console emulation

It's also possible to pass console arguments to Hollywood-compiled programs without using the console. Depending on the platform, Hollywood provides different mechanisms to pass console arguments to Hollywood-compiled programs. Below is an overview of how to pass console arguments to Hollywood programs without using a console.

Here is how to specify console arguments to Hollywood programs without using the console:

1) AmigaOS:

Simply create an icon for your program and add the console arguments you want to use as tooltypes to that icon. For example, to add a black-to-blue gradient your program in RAM:MyCoolProg, create an icon named RAM:MyCoolProg.info and add the following tooltypes to it:

 
BACKFILL=GRADIENT
STARTCOLOR=$000000
ENDCOLOR=$0000ff
BORDERLESS
FIXED
(FULLSCREEN)

Note that tooltypes enclosed in parentheses are ignored so in the above case, FULLSCREEN is not handled.

Also note that the console arguments specified above will only be handled by your program if you have set the EnableArgs tag to True in the @OPTIONS preprocessor command because by default, Hollywood-compiled programs will ignore Hollywood's standard console arguments unless scripts explicitly request not to do that.

2) Windows:

Under Windows, you can put the console arguments you want to use in an *.ini file accompanying your program. Let's assume you have compiled a program named MyCoolProg.exe with Hollywood. You have installed this program in

 
C:/Program Files/MyCoolProg/MyCoolProg.exe

You can now create an *.ini file which holds further options for this program. The *.ini file must have the same name as your program. Otherwise your program will not be able to detect that there is an *.ini file. Thus, you have to create the *.ini file as follows:

 
C:/Program Files/MyCoolProg/MyCoolProg.ini

You can then use your favorite text editor to add options to this *.ini file. For example, to create a black to blue gradient backfill for your program, you can put the following tags in MyCoolProg.ini:

 
Backfill=Gradient
StartColor=$000000
EndColor=$0000ff
Borderless=True
Fixed=True

Note that the console arguments specified above will only be handled by your program if you have set the EnableArgs tag to True in the @OPTIONS preprocessor command because by default, Hollywood-compiled programs will ignore Hollywood's standard console arguments unless scripts explicitly request not to do that.

See console arguments for more information on which arguments can be specified in the *.ini file.

3) macOS:

Under macOS, you can choose between two different ways of passing console arguments without using a console:

  1. Open the Info.plist inside the application bundle that was compiled by Hollywood with your favorite text editor. Now search for the dictionary entry named CFBundleExecutableArgs. Here you can add all the console arguments you like now. For example:

     
    <key>CFBundleExecutableArgs</key>
    <string>
    -backfill gradient -startcolor $000000 -endcolor $0000ff
    -borderless -fixed
    </string>
    

    With these console arguments specified, your program will open with a black-to-blue gradient.

    Note that the console arguments specified above will only be handled by your program if you have set the EnableArgs tag to True in the @OPTIONS preprocessor command because by default, Hollywood-compiled programs will ignore Hollywood's standard console arguments unless scripts explicitly request not to do that.

  2. Alternatively, you can also create an *.ini file just as you can do under Windows. See above for instructions on how to create such an *.ini file. The only difference under macOS is that you have to put the *.ini file inside the Resources directory of your application bundle. For instance, if your app bundle is located in this path:

     
    /Programs/MyCoolProg.app
    

    Your *.ini file has to go here then:

     
    /Programs/MyCoolProg.app/Contents/Resources/MyCoolProg.ini
    

    The rest is exactly the same as under Windows.

4) Linux:

On Linux you can also put all console arguments in an *.ini file. See above for detailed instructions.


Show TOC