Best way to target exec line in .desktop file?

Hi folks.
I’m using Mint linux 20 and Xojo 2019r1.
My app is a hierarchical listbox “menu” that populates by reading a folder named “Menu” and its subfolders. Subs contain various .desktop files, which can be launched by clicking the appropriate listbox rows.
The only way I’ve been able to make this work is by grabbing the EXEC line from inside each .desktop file. The trouble is I can’t launch more than one .desktop at a time…can’t launch a 2nd one until the currently launched one is closed. My entire app is frozen until then.
I use the shell to run this command on each .desktop to get the EXEC line:

s.Execute("awk -F= '/Exec=/{system($2)}'")

“grep ‘pattern’ file” produces “…file not found” (+full NativePath is attached to that command).
Is there a better way to do this, or is there another method I should be using?
BTW: folderitem.launch has no effect at all. My app’s windows 10 version doesn’t “lock” my app and I can launch as many apps as I want (probably due to using windows shortcuts?).
Any help would be very appreciated.

Have you tried executing this asynchronously?

s.ExecuteMode = Shell.ExecuteModes.Asynchronous

Thanks, William.
Tried as you suggested, and get this debug output:

This item does not exist
s.ExecuteMode = Shell.ExecuteModes.Asynchronous

Type “Shell” has no member named “ExecuteMode”
s.ExecuteMode = Shell.ExecuteModes.Asynchronous

Is this because I’m using 2019r1?

Ah, for 2019r1 try:

s.Mode = 1

Thanks, but the apps don’t launch at all now. :frowning:
This is so confusing. LOL

When the Shell is run Asynchronously you’ll also need to keep the Shell class from going out of scope, otherwise when the Shell goes out of scope (or is destructed) it kills the running process too.

I appreciate your help! Looks like I have some more research to do…I have no idea what “Shell class going out of scope” means. :wink:

You execute the shell
It completes and exits
The system cleans it up before the executed task can reply

One solution:

s.Mode = 1
s.Execute("awk -F= '/Exec=/{system($2)}'")
Do
    s.Poll
Loop Until Not s.IsRunning
If s.ErrorCode <> 0 Then
    // handle error/no result
Else
    theResult = s.ReadAll
End If

Thanks Tim.
There must be something else in my code (maybe elsewhere) causing this not to work, cuz it doesn’t. Your example takes me back to no response on cellclick.

EDIT: my bad. forgot to add the launcher path. I get a response now, but the menu (my app) is still locked up. Also, s.ReadAll is blank.

Tim solved this for me via PM. How to mark as solved?