OS Command (Magic xpa 4.x)
You can execute an external program, a batch, or command file at the operating system level. Magic xpa suspends the execution of the current task. When the external program, batch, or command file has been completed, Magic xpa resumes the execution of the task at the next operation.
The properties of the OS Command are:
Condition (Cnd)
OS Command
Result
Wait
Show
Block UI
Android and iOS
You can run device capabilities, such as calling a phone number, sending an SMS, and opening a browser, by using the Invoke OS command with the URL of the required command. Note that the Invoke OS command should be defined with the Execute On property set to Client.
For example:
Refer also to: http://developer.apple.com/library/safari/#featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007891-SW1"
Note: When sending mail, there are some characters that are not allowed in the subject and body. On iOS for example, the ampersand (&) character should be replaced with %26 and on Android the following characters should be removed: #,%,&, :, and =.
You can also use the convention described above to call 3rd party applications, which can be accessed via the URL format. For example, you can use:
-
'waze://?q=New York' to open the Waze GPS application and navigate to New York.
-
'geo:59.915494,30.409456’ to open a navigation app, such as Google Maps or Waze, on the 59.915494 latitude and 30.409456 longitude.
iOS
Since version: 2.3
You can print a PDF using the AirPrint protocol. You do this by using the Invoke OS command with the command of Print:filename where filename is either:
Android
Since version: 2.4
You can view a PDF using a third-party PDF viewer application. You do this by using the Invoke OS command with the command of pdf:filename where filename is a path to a local file.
For example, the following command will copy the ReleaseNotes.pdf file from the C:\Magic\ folder on the client and will open a PDF viewer to show this file: Invoke OS 'pdf:/' & ServerFileToClient('C:\Magic\ReleaseNotes.pdf')
Since version: 3.0
You can print a PDF using the Google Cloud Print protocol. You do this by using the Invoke OS command with the command of Print:filename where filename is:
Here is an example of writing the Invoke OS expression to use the md (make directory) DOS command.
The command that needs to be called is: 'cmd.exe /c md d:\a2'
cmd.exe - Executes the cmd.
/c - Executes the cmd from disk c in order to identify the operating system commands.
md - The command that you want to invoke.
d:\a2 - The arguments that the command needs - the path and the directory name.
Invoke Operations
Invoke Properties