(2021r3.1) FolderItem.Open/Launch disregarding parameters

So, I’d previously written an app in 2018r3. It was designed to operate as a proxy and launch another application via otherAppFolderItem.launch("-p param").

Admittedly, I haven’t touched it since. Also, admittedly, my current Xojo version is only 2021r3.1.

Now, for some reason, otherAppFolderItem.launch (as well as open) are disregarding the passed params and the receiving app never gets them. When I output what’s received, it’s only the name of the application itself.

What might I be missing? :thinking:

If it works with 2018r3 and not with 2021r3.1 may be a bug.

Can you create a sample project and share it here (using dropbox, google drive, etc.)

Edit: can you download Xojo 2023r1 and test? (without a license)

@AlbertoD

True, but I can’t build the target app without a license. At this point I have no idea whether launch or system.commandline is at fault so I’d need both sides. Or am I mistaken? :thinking:

I don’t have license to build desktop projects (working with web for now), so I did the best test I can:

  • replicated your files for Xojo2019r3.2 (removing Desktop from Desktop controls)
  • build
  • run and no param shown on Target
  • modified the code for Xojo2018r4 (OpenFileDialog → OpenDialog, Var → Dim, f.Open → f.Launch)
  • build
  • run and it works correctly, here a screenshot:
    image

so something is not working in Xojo2019 and Xojo2021.
Someone else will need to test in 2023r1.

I build Launcher and Target with Xojo2018 and Xojo2019 having Launcher2018, Launcher2019, Target2018 and Target2019, then did the following tests:

  • Launcher2018 and Target2018 → the parameters are received correctly
  • Launcher2018 and Target2019 → the parameters are received correctly
  • Launcher2019 and Target2018 → no parameters received
  • Launcher2019 and Target2019 → no parameters received

Launcher code:

Dim dlg As OpenDialog
Dim f As FolderItem
dlg = New OpenDialog

f = dlg.ShowModal

If f <> Nil Then
  f.Launch("-p param -z zaram -c caram")
end if

Changing OpenDialog to OpenFileDialog and f.Launch to f.Open doesn’t make a difference in Launcher2019.

We just need someone that can compile in Xojo2023 to confirm this still the case to file an Issue with all the information. Thanks.

1 Like

Try this:

Public Function gCallTextAreaOpenFolderitem(TA as TextArea, f as FolderItem) As String
  Dim TIS as TextInputStream
  Dim TheFileContents as string
  
  TIS = TextInputStream.Open(f)
  
  TheFileContents = TIS.Readall
  
  Return TheFileContents
End Function

Thanks for the input, that’s the “target” dialog simply showing what it was passed. The problem is that it’s actually not being passed in the stated combinations of Xojo.

I’ve also just verified that, at it’s not getting sent in 2023 either.

Ok, I saw that you created an Issue:
#72394 - (2021r3.1) FolderItem.Open/Launch disregarding parameters

I added the Files and the steps to reproduce so Robin does not need to spend time looking at the forum for them.

1 Like

Excellent, much appreciated @AlbertoD

1 Like

I’d say you are :wink:

I’ve tried your 2 projects file (which indeed don’t work). Then, I built the 2nd app (the receiver) and launched it using the Terminal:
/Users/me/Downloads/XojoLaunchTest/Builds\ -\ TargetApp/macOS\ Universal/TargetApp.app/Contents/MacOS/TargetApp -test
And the whole string was correctly passed. So it looks like the problem is at the launch side.

That’s what we are trying to say.

Launch in Xojo2018 works
Launch in Xojo2019 and later doesn’t work.

Yes, but Michael wondered whether it didn’t work at the send side or the receive side:

And I didn’t see it answered, hence my post.

I’m sorry, I thought it was obvious by look at this answer:

I guess I have to be more clear the next time by adding something like this after:
“Target works correctly is the Launcher that only works with Xojo2018 and stopped working with Xojo2019(didn’t test r1 or r2) and later”

No problem, thank you for your info.

My mistake. I skipped this paragraph because I thought it was only discussing about Xojo versions, while I was focalized on the “under the hood” part.

1 Like