Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Application.ApplicationCreatorCodeMBS as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Process MBS Util Plugin Yes No No Yes, macOS only No
Function: Returns the Creator Code of the application.
Example:
msgbox "Hi. This application has the creator code "+app.ApplicationCreatorCodeMBS
Notes:
Only useful on Mac OS.
If you run your app inside the Realbasic IDE it will return "RBv2" which is Realbasic's Creator code sind Realbasic 2.0.

Some examples which use this method:

Feedback, Comments & Corrections

Application.ApplicationFileMBS as folderitem
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Process MBS Util Plugin Yes Yes No Yes No
Function: Gives a folderitem to the applications file.
Example:
msgbox "Hi. The file of this application is named "+app.ApplicationFileMBS.name
Notes:
Inside Realbasic points to the Realbasic application.

This item may go in the future. Please use app.executablefile in new Realbasic versions.

Some examples which use this method:

Feedback, Comments & Corrections

Application.ApplicationNameMBS as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Process MBS Util Plugin Yes No No Yes, macOS only No
Function: Returns the name of the application.
Example:
msgbox "Hi. This application is named "+app.ApplicationNameMBS
Notes: This may not be the exact same name than the filename.

Some examples which use this method:

Feedback, Comments & Corrections

Application.ArgumentsMBS as String()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Process MBS Util Plugin 15.2 Yes Yes Yes Yes No
Function: Queries arguments of process.
Notes:
Returns nil in case of any error (low memory).
First entry in result is path to current app.
Other entries are parameters, without any quotes.

Some examples which use this method:

Feedback, Comments & Corrections

Application.FrontmostMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Process MBS Util Plugin Yes No No Yes, macOS only No
Function: Returns true if the application is frontmost.
Example:
app.frontmostmbs=True 'bring app to front
Notes:
This property is for read and write. Writing to it brings the app to front.
Setting this property to false does nothing.

If you need to make some other application frontmost, you can use app.HideMeMBS or use the ProcessMBS class.
(Read and Write computed property)

Some examples which use this property:

Feedback, Comments & Corrections

Application.HideMeMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Process MBS Util Plugin 3.2 Yes No No Yes, macOS only No
Function: Hides the current application.
Notes:
Returns true if the current application was hidden.
Returns false on Carbon running on Mac OS 9 or Windows.

Some examples which use this method:

Feedback, Comments & Corrections

Application.HideOthersMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Process MBS Util Plugin 3.2 Yes No No Yes, macOS only No
Function: Hides all applications except the current one.
Notes:
Returns true if the other applications were hidden.
Returns false on Carbon running on Mac OS 9 of Windows.

Some examples which use this method:

Feedback, Comments & Corrections

Application.LaunchTimeMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Process MBS Util Plugin Yes No No Yes, macOS only No
Function: Returns the the ticks value at launch time.
Example:
dim d as date

d=new date
d.totalSeconds=d.totalSeconds-(ticks-app.launchTimeMBS)/60

msgbox d.longdate+" "+d.longtime
Notes:
This value must be converted to the secondsvalue like in the example.
-1 on Windows.
For Mac OS X see the DarwinResourceUsageMBS class.

Feedback, Comments & Corrections

Application.ProcessTimeMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Process MBS Util Plugin Yes No No Yes, macOS only No
Function: Returns the current CPU time for the process.
Example:
msgbox "I got "+format(app.ProcessTimeMBS/100,"0.00")+" seconds CPU time till now."
Notes:
On Mac OS X, the OS counts how much CPU time in given to the current process.
On Mac OS 9 you can get this information for any process using the ProcessMBS class.
Returns -1 in case of an error.

You can do this function yourself if you like:

dim s as SoftDeclareMBS

s=new SoftDeclareMBS

if s.LoadLibrary("System.Framework") then
if s.LoadFunction("clock") then
if s.Call(0,nil) then
MsgBox "clock: "+str(s.Result)+chr(13)+"app.ProcessTime: "+str(app.ProcessTime)
end if
end if
end if

You may need to add Error Checking code.

Some examples which use this method:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Util Plugin.




Links
MBS Xojo tutorial videos