| 4D v18Command Line Interface | ||||||||||||||||||||||||||
| 
 | 
    4D v18
 Command Line Interface 
         | |||||||||||||||||||||||||
| Argument | Value | Description | 
| applicationPath | Path of the 4D, 4D Server or merged application | Launches the application. Identical to double-clicking the 4D application. When called without structure file argument, the application is executed and the 'select database' dialog box appears. | 
| --structure | structurePath | packagePath | 4dlinkPath | Structure file to open with the current data file. No dialog box appears. | 
| --data | dataPath | Data file to open with the designated stucture file. If not specified, 4D uses the last opened data file. | 
| --opening-mode | interpreted | compiled | Requests database to open in interpreted or compiled mode. No error is thrown if the requested mode is unavailable. | 
| --create-data | Automatically creates a new data file if no valid data file is found. No dialog box appears. 4D uses the file name passed in the "--data" argument if any (generates an error if a file with the same name already exists). | |
| --user-param | Custom user string | A string that will be available within the 4D application through the Get database parameter command (the string must not start with a "-" character, which is reserved). | 
| --headless | Launches the 4D, 4D Server or merged application without interface (headless mode). In this mode: | 
(*) Some dialogs are displayed before the database is opened, so that it's impossible to write into the Diagnostic log file (licence alert, conversion dialog, database selection, data file selection). In such case, an error message is thrown both in the stderr stream and the system event log, and then the application quits.
These examples assume that your 4D application is stored on the desktop and that the database to be opened is found in the "Documents" folder.
Note: The current folder of the user is reached using the "~ " command under macOS and the "%HOMEPATH%" command under Windows.
open ~/Desktop/4D.app%HOMEPATH%\Desktop\4D\4D.exeopen ~/Desktop/4D.app --args ~/Documents/myDB.4dbase%HOMEPATH%\Desktop\4D\4D.exe %HOMEPATH%\Documents\myDB.4dbase\myDB.4dbopen ~/Desktop/4D.app --args --structure ~/Documents/myBase.4dbase --data ~/Documents/data/myData.4DD%HOMEPATH%\Desktop\4D\4D.exe --structure %HOMEPATH%\Documents\myBase.4dbase\myDB.4db --data %HOMEPATH%\Documents\data\myData.4DD
or:
%HOMEPATH%\Desktop\4D\4D.exe /structure %HOMEPATH%\Documents\myBase.4dbase\myDB.4db /data %HOMEPATH%\Documents\data\myData.4DDopen ~/Desktop/4D.app MyDatabase.4DLinkopen "~/Desktop/4D Server.app" MyDatabase.4DLink%HOMEPATH%\Desktop\4D.exe MyDatabase.4DLink"%HOMEPATH%\Desktop\4D Server.exe" MyDatabase.4DLinkopen ~/Desktop/4D.app ~/Documents/myBase.4dbase --args --opening-mode compiled --create-data true%HOMEPATH%\Desktop\4D\4D.exe %HOMEPATH%\Documents\myBase.4dbase\myDB.4db --opening-mode compiled --create-data trueopen ~/Desktop/4D.app --args --structure ~/Documents/myBase.4dbase --data ~/Documents/data/myData.4DD --user-param "Hello world"%HOMEPATH%\Desktop\4D\4D.exe --structure %HOMEPATH%\Documents\myBase.4dbase\myDB.4db --data %HOMEPATH%\Documents\data\myData.4DD --user-param "Hello world"open ~/Desktop/4D.app --args --structure ~/Documents/myBase.4dbase --data ~/Documents/data/myData.4DD --headlessopen ~/Desktop/MyBuiltRemoteApp −−headless%HOMEPATH%\Desktop\4D\4D.exe --structure %HOMEPATH%\Documents\myBase.4dbase\myDB.4db --data %HOMEPATH%\Documents\data\myData.4DD --headless
[#codeRAW]%HOMEPATH%\Desktop\4D\MyBuiltRemoteApp.exe --headless
	Product:  4D
	Theme:  Managing 4D databases
	
        
        
	
	Modified:  4D v17 R3
	Modified:  4D v17 R6
	4D Design Reference ( 4D v18)
	
	
	
 Add a comment
Add a comment