Execute another app?

I ceased software development many months ago now, and am therefore having trouble getting my app to do something simple - such as executing a different OS X app which is in the Applications folder.

Here is my code:

Dim sh As New Shell sh.Execute("/Applications/MyApp.app")

Is my path incorrect, or is this the wrong way to execute another app?

Thank you all in advance :slight_smile:

Hi Richard :slight_smile:
Thats the error code?
You can also use a folderitem and .Launch

f.launch ?

There is no error code, and it compiles fine - just nothing happens when I click on the button :frowning:

I also tried this:

Dim f As FolderItem = SpecialFolder.Applications.Child("MyApp.app") f.launch

This also compiles fine - but does absolutely nothing :frowning:

Thats strange. That works here with the Twitter app:

  Dim f As FolderItem = SpecialFolder.Applications.Child("Twitter.app")

Albin - how would I path to an app which is in a folder, inside the applications folder?
My brain has completely switched off with regards to Xojo :frowning:

Example - if the app I need to execute is in:

I tried this - with the same result:

Dim f As FolderItem = SpecialFolder.Applications.Child("MyApp").Child("MyApp.app") f.launch


Isn’t it something like SpecialFolder.Applications.Child(“MyApp”).Child(“MyApp.app”)

I forgot to substitute “MyApp” with the real name of my app!!!

Embarrassing :slight_smile:

Thanks guys.