Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

GlobalIdleTimeMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method System MBS MacOSX Plugin 13.2 Yes Yes No Yes No
Function: Queries the current global idle time on a Mac.
Example:
MsgBox Format(GlobalIdleTimeMBS,"0.0")+" seconds idle"
Notes:
The return value is the number of seconds the user did not use mouse or keyboard.
Returns 0 on any error.

Some examples using this method:

Feedback, Comments & Corrections

MacGlobalIdleTimeMBS as UInt64
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method System MBS MacOSX Plugin 10.0 Yes No No Yes, macOS only No
Function: Queries the current global idle time on a Mac.
Example:
MsgBox Format(MacGlobalIdleTimeMBS/1000000000.0,"0.0")+" seconds idle"
Notes:
The return value is the number of nanoseconds the user did not use mouse or keyboard.
Returns 0 on any error.

Deprecated in 13.2 plugins in favor of GlobalIdleTimeMBS.

Some examples using this method:

Feedback, Comments & Corrections

MacMountServerVolumeMBS(URL as string, MountDir as String, User as String, Password as String, byref Disk as FolderItem, flags as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method System MBS MacOSX Plugin 16.1 Yes No No Yes, macOS only No
Function: This routine will mount the server specified by url at mountDir (or the default location if mountDir is empty).
Example:
dim flags as Integer = 0
dim disk as FolderItem
dim URL as string = "smb://Test.local"
dim user as string = "root"
dim pass as string = "xxx"

dim e as Integer = MacMountServerVolumeMBS(URL, "", user, pass, disk, flags)

if e = 0 then
MsgBox "OK"
else
MsgBox disk.NativePath
end if
Notes:
An optional user and password can be passed in for authentication. If no user or password is provided then the underlying file system will handle authentication if required. This routine returns after the mount is complete.

url: The server to mount.
mountDir: The directory to mount the server to (default if empty).
user: String to pass as user for authentication.
password: String to pass as password for authenticated log in.
Disk: The folderItem of the newly mounted volume.
Flags: Options (such as kFSMountServerMarkDoNotDisplay and kFSMountServerMountOnMountDir).

ConstantValueDescription
kFSMountServerMarkDoNotDisplay1Specify this option if you do want the volume displayed as a stand
along volume in the UI.
kFSMountServerMountOnMountDir4Specify this option if you want the volume mounted on the mountdir passed in instead of in it.
kFSMountServerSuppressConnectionUI&h40Specify this option if you want to suppress connection-time UI when mounting the server volume.

Returns Mac OS X error code. Zero for success.

Feedback, Comments & Corrections

MacUnmountVolumeMBS(volume as folderItem, Force as Boolean, byref dissenter as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method System MBS MacOSX Plugin 16.1 Yes No No Yes, macOS only No
Function: This routine unmounts the volume specified by FolderItem.
Example:
dim u as Integer = VolumeCount-1
for i as Integer = 0 to u
dim v as FolderItem = volume(i)

if v.Name = "TestServer" then
dim dissenter as Integer = 0
dim e as Integer = MacUnmountVolumeMBS(v, false, dissenter)

if e = 0 then
MsgBox "Unmounted"
else
MsgBox "Failed to unmount with error "+str(e)+". The app with PID "+str(dissenter)+" blocks it."
end if
end if
next
Notes:
If the volume cannot be unmounted the pid of the process which denied the unmount will be returned in the dissenter parameter. This routine returns after the unmount is complete.

Force: Specify true if you want the volume forcibly unmounted. Force unmounting a volume will very likely result in data loss since the volume will be ejected even if there are open files on it. This option should be reserved for situations such as the backing store for a volume is gone (so the data is lost regardless).

dissenter: pid of the process which denied the unmount if the unmount is denied.

Returns Mac OS X error code. Zero for success.

Feedback, Comments & Corrections

StartDictationMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method System MBS MacOSX Plugin 13.1 Yes No No Yes, macOS only No
Function: Starts dictation.
Notes: This is for Carbon application. For Cocoa use methods on NSApplicationMBS.

Some examples using this method:

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins