@Mark In Settings, it reports that I have 6.48 GB available. Here’s the code. As I said, I made a lot of changes and haven’t tested it that much. So copy this code to both iPads. On the iPad Air, create a backup file. That will be in the Dropbox folder. Sync that with Dropbox and then sync the iPad Pro to get the backup file on the Pro. Run the backup program and tap Select a backup. You should see a list of your projects. Tap Turn all projects on, tap Allow restore, then tap Restore selected items. It should then create all of you projects on the Pro. Let me know how it goes or if you have other questions.
EDIT: Run this in portrait mode. If you already have projects created, you can select just the projects you want to restore, or you can select Allow overwrite to overwrite existing projects.
displayMode(FULLSCREEN)
function setup()
delay=5
pns="PROJ".."NAME".."START" -- project name start
pne="PROJ".."NAME".."END" -- project name end
tns="TAB".."NAME".."START" -- tab name start
tne="TAB".."NAME".."END" -- tab name end
te="TAB".."END" -- tab end
pe="PROJ".."END" -- project end
bk1,bk2,bk3,bk4="","","",""
msg1=""
m1=button(WIDTH/2,HEIGHT-100,200,50,"Create a backup",createBkup)
m2=button(WIDTH/2,HEIGHT-200,200,50,"Select a backup",getBkups)
m3=button(WIDTH/2,HEIGHT-300,200,50,"Exit",exit)
b1=button(190,HEIGHT-200,180,50,"Turn all projects on.",allOn)
b2=button(190,HEIGHT-260,180,50,"Turn all projects off.",allOff)
b3=button(190,HEIGHT-360,180,50,"Allow overwrite. OFF",allowOverwrite)
b4=button(190,HEIGHT-420,180,50,"Allow restore. OFF",allowRestore)
b5=button(190,HEIGHT-520,180,50,"Restore selected items",restore)
b6=button(190,100,180,50,"Return to menu",retn)
func=menu
end
function draw()
background(40, 40, 50)
func()
end
function touched(t)
if t.state==ENDED then
if func==menu then
m1:touched(t)
m2:touched(t)
m3:touched(t)
elseif func==showBkups then
for a,b in pairs(bkupTab) do
if math.abs(t.x-WIDTH/2)<100 and math.abs(t.y-(HEIGHT-a*75+dy))<25 then
selectedBackupFile=b
func=getProjects
end
end
b6:touched(t)
elseif func==showProjects then
for a,b in pairs(projTab) do
if math.abs(t.x-WIDTH/2)<100 and math.abs(t.y-(HEIGHT-a*75+dy))<25 then
b.sel=not b.sel
end
end
b1:touched(t)
b2:touched(t)
b3:touched(t)
b4:touched(t)
b5:touched(t)
b6:touched(t)
elseif func==showRestoreTable then
b6:touched(t)
end
end
if t.state==MOVING then
if func==showProjects or func==showRestoreTable then
if t.x<100 or t.x>WIDTH-100 then
sp=1
if t.y<HEIGHT/2 then
sp=20
end
dy=dy+t.deltaY*sp
if dy<0 then
dy=0
end
end
end
end
end
function menu()
fill(255)
m1:draw()
m2:draw()
m3:draw()
text(bk1,WIDTH/2,300)
text(bk2,WIDTH/2,260)
text(bk3,WIDTH/2,220)
text(bk4,WIDTH/2,180)
end
function exit()
close()
end
function retn()
func=menu
end
function createBkup()
if delay>0 then
func=createBkup
text("Creating backup",WIDTH/2,HEIGHT/2)
delay=delay-1
return
end
local proj=listProjects("Documents")
local t=os.date("*t")
backupName=string.format("bkA%02d%02d%02d-%02d%02d",
t.month,t.day,t.year%100,t.hour,t.min)
local temp={}
local dt=os.date()
local cnt=0
table.insert(temp,"BKUP==START.."..dt)
for a,b in pairs(proj) do
lst=listProjectTabs(b)
cnt=cnt+1
table.insert(temp,pns.."=="..b.."=="..pne)
for c,d in pairs(lst) do
table.insert(temp,tns.."=="..d.."=="..tne)
table.insert(temp,readProjectTab(b..":"..d))
table.insert(temp,"=="..te)
end
table.insert(temp,"=="..pe)
end
table.insert(temp,"BKUP==END")
local str=table.concat(temp,"\
")
bk1=backupName
bk2=dt
bk3="Projects saved = "..cnt
bk4="File size = "..#str.." bytes"
saveText("Dropbox:"..backupName,str)
delay=5
func=menu
end
function getBkups()
bk1,bk2,bk3,bk4="","","",""
bkupTab={}
showBackupTable=true
dy=0
local lst=assetList("Dropbox")
for a,b in pairs(lst) do
if string.find(b,"bk") then
table.insert(bkupTab,b)
end
end
func=showBkups
end
function showBkups()
for a,b in pairs(bkupTab) do
sprite("Cargo Bot:Dialogue Button",WIDTH/2,HEIGHT-a*75+dy,200,50)
text(b,WIDTH/2,HEIGHT-a*75+dy)
end
b6:draw()
end
function getProjects()
text("Please wait, getting a list of all projects",WIDTH/2,HEIGHT/2)
projTab={}
local name=selectedBackupFile
bkupFile=readText("Dropbox:"..name)
if bkupFile==nil then
msg1="No backup file selected."
return
end
local sss=pns.."==(.-)=="..pne
for projName,proj in string.gmatch(bkupFile,sss) do
table.insert(projTab,{proj=projName,sel=false,res=""})
end
dy=0
func=showProjects
end
function showProjects()
text("Tap a project to select or unselect it.",WIDTH/2,HEIGHT-20+dy)
for a,b in pairs(projTab) do
sprite("Cargo Bot:Dialogue Button",WIDTH/2,HEIGHT-a*75+dy,200,50)
fill(255)
if b.sel then
fill(255,0,0)
end
text(b.proj,WIDTH/2,HEIGHT-a*75+dy)
if b.res~="" then
sprite("Cargo Bot:Dialogue Button",575,HEIGHT-a*75+dy,150,50)
text(b.res,575,HEIGHT-a*75+dy)
end
end
b1:draw()
b2:draw()
b3:draw()
b4:draw()
b5:draw()
b6:draw()
scrollArea()
text(msg1,200,100)
end
function scrollArea()
fill(97, 229, 165, 100)
rect(0,HEIGHT/2+20,100,HEIGHT)
rect(0,0,100,HEIGHT/2-20)
rect(WIDTH-100,HEIGHT/2+20,100,HEIGHT)
rect(WIDTH-100,0,100,HEIGHT/2-20)
fill(255)
text("SLOW\
SCROLL\
AREA",50,HEIGHT*.75)
text("FAST\
SCROLL\
AREA",50,HEIGHT*.25)
text("SLOW\
SCROLL\
AREA",WIDTH-50,HEIGHT*.75)
text("FAST\
SCROLL\
AREA",WIDTH-50,HEIGHT*.25)
end
function allOn()
for a,b in pairs(projTab) do
b.sel=true
end
end
function allOff()
for a,b in pairs(projTab) do
b.sel=falss
end
end
function allowOverwrite(self)
Allow_overwrite=not Allow_overwrite
if Allow_overwrite then
self.name="Allow overwrite. ON"
self.col=color(0,255,0)
else
self.name="Allow overwrite. OFF"
self.col=color(255)
end
end
function allowRestore(self)
Allow_restore=not Allow_restore
if Allow_restore then
self.name="Allow restore. ON"
self.col=color(0,255,0)
else
self.name="Allow restore. OFF"
self.col=color(255)
end
end
function restore()
resTab={}
msg1=""
if not Allow_restore then
msg1="Allow restore not ON"
return
end
if projTab==nil or selectedBackupFile=="" then
msg1="No projects selected"
return
end
dy=0
cnt=0
for a,b in pairs(projTab) do
if b.sel then
cnt=cnt+1
pname=b.proj
restoreProject()
end
end
if cnt>0 then
msg1="Restore complete"
else
msg1="Nothing selected for restore."
end
allOff()
allowRestore(b4)
if Allow_overwrite then
allowOverwrite(b3)
end
dy=0
func=showRestoreTable
end
function restoreProject()
name=pname
local sss=pns.."==(.-)=="..pne.."\
(.-)=="..pe
if hasProject(name) then
if Allow_overwrite then
deleteProject(name)
else
table.insert(resTab,{proj=name,res="Overwrite OFF"})
return
end
end
if not hasProject(name) then
createProject(name)
for projName,proj in string.gmatch(bkupFile,sss) do
if name==projName then
getTab(proj)
end
end
table.insert(resTab,{proj=name,res="Restored"})
end
end
function getTab(proj)
local sss=tns.."==(%g+)=="..tne.."\
(.-)\
=="..te
for tabName,tab in string.gmatch(proj,sss) do
saveProjectTab(name..":"..tabName,tab)
end
end
function showRestoreTable()
for a,b in pairs(resTab) do
sprite("Cargo Bot:Dialogue Button",400,HEIGHT-a*75+dy,200,50)
fill(255)
text(b.proj,400,HEIGHT-a*75+dy)
sprite("Cargo Bot:Dialogue Button",575,HEIGHT-a*75+dy,150,50)
text(b.res,575,HEIGHT-a*75+dy)
end
b6:draw()
scrollArea()
end
button=class()
function button:init(x,y,w,h,n,f)
self.x=x
self.y=y
self.w=w
self.h=h
self.name=n
self.func=f
self.col=color(255)
end
function button:draw()
sprite("Cargo Bot:Dialogue Button",self.x,self.y,self.w,self.h)
fill(self.col)
text(self.name,self.x,self.y)
end
function button:touched(t)
if math.abs(t.x-self.x)<self.w/2 and math.abs(t.y-self.y)<self.h/2 then
self.func(self)
end
end