is there a method to open external apps other than shell.
The editor i am using is the app, “sublime” . and if shell opens it with a file to edit, it will always open in a new window regardless of the app’s internal settings.
i wanted to know if xojo has another method of opening apps.
folderitem.launch
There’s also declares if you’d like to open {file} with {specific app}
do you have the code for declares for opening files with specific app ?
[code]dim sAppToOpenWith as String = “Safari.app”
dim fFileToShow as FolderItem
#if TargetMacOS then
// Launch help with selected preview browser
declare function NSClassFromString Lib “Foundation” (name as CFStringRef) as Ptr
declare function sharedApplication Lib “AppKit” Selector “sharedWorkspace” (obj As Ptr) as Ptr
dim sharedWorkspace as ptr = sharedApplication(NSClassFromString(“NSWorkspace”))
declare function openFile Lib “AppKit” Selector “openFile:withApplication:” (id as ptr, urlString as CFStringRef, appName as CFStringRef) as Boolean
call openFile(sharedWorkspace, fFileToShow.NativePath, sAppToOpenWith)
#endif[/code]
Note that you don’t want to use this in conjunction with “Finder.app” - if you’re going to do that, FolderItem.Launch
will suffice. This is specifically for “I want to open file.jpg with Xojo.app”
i will go with the declares and not use finder.
Thank you it is great. !