Check for open app?

I also just tried commenting out that line, and `I still get the same result?
Weird.

Here is my code now:

[code]// CHECK TO SEE IF XOJO IS RUNNING
Dim sh As New Shell
sh.execute “lsappinfo list | grep -v grep | grep bundleID | grep com.xojo.xojo | wc -l”

Dim shOutput As String = Sh.ReadAll
If shOutput = “0” Then

// DISPLAY A USER NOTIFICATION
m = New Module1.MyNotificationCenter
m.DeliverNotification(Module1.NSNotifications("Test App:","Xojo is not currently running."))

Else

// DISPLAY A USER NOTIFICATION
m = New Module1.MyNotificationCenter
m.DeliverNotification(Module1.NSNotifications("Test App:","Xojo is running."))

End if[/code]

// CHECK TO SEE IF XOJO IS RUNNING Dim sh As New Shell
sh.Mode = 2

[code] sh.execute “lsappinfo list | grep -v grep | grep bundleID | grep com.xojo.xojo | wc -l”

[/code] Dim shOutput As String = Sh.ReadAll

[code] Dim shOutput As String = Sh.Result
If shOutput = “0” Then

// DISPLAY A USER NOTIFICATION
m = New Module1.MyNotificationCenter
m.DeliverNotification(Module1.NSNotifications("Test App:","Xojo is not currently running."))

Else

// DISPLAY A USER NOTIFICATION
m = New Module1.MyNotificationCenter
m.DeliverNotification(Module1.NSNotifications("Test App:","Xojo is running."))

End if[/code]

[quote=301526:@Richard Summers]I also just tried commenting out that line, and `I still get the same result?
[/quote]
Are you testing this by running it in a debug app in the IDE ?

If so think about what its telling you “Yes the IDE is running”

I’m running the built app and Xojo is closed.

Ok - here is my code - it should now be identical to yours:
I have closed Xojo and am running the built app, but I still keep getting told that Xojo is running ? This should now be working?

[code]// CHECK TO SEE IF XOJO IS RUNNING
Dim sh As New Shell
sh.execute “lsappinfo list | grep -v grep | grep bundleID | grep com.xojo.xojo | wc -l”

Dim shOutput As String = Sh.Result
If shOutput = “0” Then

// DISPLAY A USER NOTIFICATION
m = New Module1.MyNotificationCenter
m.DeliverNotification(Module1.NSNotifications("Test App:","Xojo is not currently running."))

Else

// DISPLAY A USER NOTIFICATION
m = New Module1.MyNotificationCenter
m.DeliverNotification(Module1.NSNotifications("Test App:","Xojo is running."))

End if[/code]

ah its space padded

change
If shOutput = “0” Then
to
If shOutput.trim() = “0” Then

That was it!!!
Thank you so much for your patience Norman - I would never have guessed that was the issue!

THANK YOU!

If someone wants to do this without shell, we do have a few classes in MBS Plugin to list processes:

ProcessMBS for Mac and Windows:
http://www.monkeybreadsoftware.net/classes-P.shtml

LinuxProcessMBS class:
http://www.monkeybreadsoftware.net/class-linuxprocessmbs.shtml

And Mac only the NSRunningApplicationMBS class
http://www.monkeybreadsoftware.net/class-nsrunningapplicationmbs.shtml