Launch with specific app?

I need to open a .png file in the, as opposed to the default app (photoshop).

I have looked in the language reference, but it has no example of defining the app to open the file in.

Can anyone help.

Thank you all in advance.

You need declares or MBS. I’ve since lost the declare, but here’s the MBS solution:

var tfPNG as FolderItem = // Your png folder item

  if NSWorkspaceMBS.openURL(tfPNG.URLPath, "") then
    // Success!

Another option is using AppleScript from the Xojo code to open a file in a particular application.

Another option is to simply change the default app of .png files to preview.