Platforms to show: All Mac Windows Linux Cross-Platform

/MacClassic/openwithapp test


Required plugins for this example: MBS MacClassic Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacClassic/openwithapp test

This example is the version from Thu, 31th Jul 2019.

Project "openwithapp test.xojo_binary_project"
FileTypes
Filetype any
Filetype appx
End FileTypes
Class Window1 Inherits Window
Control pbopenwith Inherits PushButton
ControlInstance pbopenwith Inherits PushButton
EventHandler Sub Action() dim b as boolean dim prog,ff as folderItem dim sourcef as folderitem dim savedstr as string dim tel, foutteller as integer dim dofile as boolean prog = getfolderitem(stapp.text) if prog = nil or prog.exists=false then msgBox "Could not find application to lauch with" return end if ff = getfolderItem(stdoc.text) if ff = nil or ff.exists=false then msgBox "The selected file can't be found" return end if b = ff.OpenWithAppMBS(prog,true) if b=false then msgBox "error" end if End EventHandler
End Control
Control pbselapp Inherits PushButton
ControlInstance pbselapp Inherits PushButton
EventHandler Sub Action() dim ff as folderItem Dim dlg as OpenDialog dim pth as string dlg=New OpenDialog dlg.Title="Select an application" dlg.Filter="appx" ff=dlg.ShowModal() if dlg.result <> nil then pth = dlg.result.NativePath if right(pth,1)=":" then //for os x apps pth=left(pth,len(pth)-1) end if stapp.text= pth end if End EventHandler
End Control
Control pbseldoc Inherits PushButton
ControlInstance pbseldoc Inherits PushButton
EventHandler Sub Action() dim f as folderItem f=getopenFolderItem("any") if f <> nil then stdoc.text= f.NativePath end if End EventHandler
End Control
Control stapp Inherits Label
ControlInstance stapp Inherits Label
End Control
Control stdoc Inherits Label
ControlInstance stdoc Inherits Label
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project

The items on this page are in the following plugins: MBS MacClassic Plugin.


The biggest plugin in space...