After doing some reading and searching through the forum, I read that MBS has something that will “do the job” for me.
So I went to MonkeyBread Software and found the Xojo Plugins (currently for evaluation) but there is something like 54 to choose from.
Which one do I need?
Also I found this in the forum from ChristophDV:
Found it with MBS
`dim myProcess as ProcessMBS
myProcess=new ProcessMBS
myProcess.GetCurrentProcess
if myProcess.TransformProcessType(myProcess.kProcessTransformToUIElementApplication) = 0 then
end if`
To show the Dock Icon again:
`if myProcess.TransformProcessType(myProcess.kProcessTransformToForegroundApplication) = 0 then
end if`
[/quote]
I assume that because he calls ProcessMBS that HE is using MonkeyBread Software Plugins?
Usually I just download them all (there’s a “Complete” package) and put them all in the “Plugins” folder. You don’t need to limit to only the correct one being installed.
Correct. All the additions that the MBS plugins provide are suffixed with “MBS”, exactly to make this obvious.
Although I don’t use this particular feature of the MBS plugins, what I do to find which Plugin files to use, is the following:
From the MBS Xojo website, click on the “Documentation” link on the left, then the “Classes” link.
This opens the MBS List of Classes, from which you can lookup ProcessMBS under the “P” directory.
Which brings me to the ProcessMBS documentation page. At the top of the page, it tells you which Plugin file this class belongs to. In this case the MBS Util Plugin.
Some MBS Plugins have dependencies to other Plugin files, so always double-check the Dependencies page (also linked on the left) to see if you need any others. In this case, it looks like all you need is the MBS Xojo Util Plugin.xojo_plugin file.
Drop the file into your Xojo /Plugins folder, then restart the IDE for it to recognize it.
When you use Plugins Pro you aren’t meant to dig around the /Managed/ folder.
Drag both MBS Xojo Util Plugin.xojo_plugin and MBS Xojo Main Plugin.xojo_plugin into Plugins Pro, ensure both the plugin set and plugins themselves are checked (to mean “active and installed”), and click “Apply Changes”. When you next launch Xojo, both the Main and Util plugins should be installed and active.
and ran a little test program with the ChristophDV code, and I do see my dock icon for my temporary program disappear from the mac dock.
Now, how do I make the entire dock and menubars disappear? I’m going through the MBS Docs right now, but if I can be pointed in the right direction, that would help.
Yeah, that’s why using the MBS to make the dock icon disappear isn’t very useful. Instead use this in a build script:
'set scheduler to be a background app
dim dbg as String
if debugBuild then dbg = ".debug"
dim appNameForShell as string
appNameForShell = PropertyValue("App.MacOSXAppName") + dbg +".app" + "/Contents/Info.plist"
appNameForShell = replaceall(appNameForShell, " ", "\ ")
dim theResult as string
theResult = DoShellCommand("/usr/libexec/PlistBuddy -c ""Add :NSUIElement string \""true\"""" " + CurrentBuildLocation + "/" + appNameForShell )
if theResult <> "" then print theResult