Platforms to show: All Mac Windows Linux Cross-Platform

/Main/Convert RBX to folder RBX


Required plugins for this example:

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Main/Convert RBX to folder RBX

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

Project "Convert RBX to folder RBX.xojo_binary_project"
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
EventHandler Sub Open() AutoQuit = true dim sourceFolder as FolderItem = GetFolderItem("/Applications/REALbasic/Plugins", folderitem.PathTypeShell) dim destFolder as FolderItem = GetFolderItem("/Applications/REALbasic/PluginsNewStyle", folderitem.PathTypeShell) if sourceFolder.Exists = false or destFolder.Exists = false then MsgBox "Please change paths in app.open!" else Process sourceFolder, destFolder end if End EventHandler
Sub Copy(source as FolderItem, dest as FolderItem) if source.Directory then dim c as integer = source.Count for i as integer = 1 to c dim f as FolderItem = source.TrueItem(i) if f=nil then 'ignore elseif f.Directory then dim d as FolderItem = dest.Child(f.name) d.CreateAsFolder Copy f, d else CopyFile f, dest end if next else CopyFile source, dest end if End Sub
Sub CopyFile(source as FolderItem, z as FolderItem) source.CopyFileTo z End Sub
Sub CopyRoot(source as FolderItem, dest as FolderItem) dim c as integer = source.Count for i as integer = 1 to c dim f as FolderItem = source.TrueItem(i) if f<>nil and f.Directory then dim d as FolderItem = dest.Child(f.name) d.CreateAsFolder Copy f, d end if next End Sub
Sub Process(folder as FolderItem, destfolder as FolderItem) dim files() as FolderItem dim c as integer = folder.Count for i as integer = 1 to c files.append folder.TrueItem(i) next for each f as FolderItem in files if f<>Nil and f.Exists and f.Visible and f.Directory = false then if Right(f.Name,4) = ".rbx" then ProcessFile f, destfolder end if end if next End Sub
Sub ProcessFile(file as FolderItem, destfolder as FolderItem) dim destfile as FolderItem = destfolder.Child(file.Name) dim v as VirtualVolume = file.OpenAsVirtualVolume if v = nil then MsgBox file.Name+" is not a valid plugin!?" quit end if System.DebugLog destfile.NativePath destfile.CreateAsFolder CopyRoot v.Root, destfile End Sub
End Class
End Project

See also:

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


The biggest plugin in space...