@Simeon Exactly what is the export option going to do and where is the zip file going to be. Does it do anything to the existing projects because I have 400+ projects that I don’t want to have to fix.
@yojimbo2000 I tried the export on my 475 projects. It took about 20 seconds before it asked me where to put the file. I picked Dropbox and that took about a minute before it was done. My zip file shows 6.5 MB. @Simeon I like the comments that show as the zip file is created.
@yojimbo2000 the import will display a panel asking you to select which projects or assets to import. It won’t do anything until you confirm the import. But yeah, it might be better to test it with a zip file of one or two projects, or assets. It should be able to import anything that Codea can read from a zip file.
@dave1707 I think if you are an advanced user that has more than 400 projects then we’re not going to be able to offer the perfect solution for project management. Thank you for prompting me about the create project API, hopefully it lets you build what you need.
@Simeon Thanks for the listProjects, createProject, and deleteProject functions. I have code already written to use them, I was just waiting for those functions to show up. I’ll be changing my code now that I can actually test with them to create something useful.
@Simeon After some thought, I think createProject should return true if it creates a project, return false without touching a project if the project exists. If it returns false, then I can determine why I’m trying to create an existing project. If needed, I could then delete the project and then create it. Same goes for deleteProject. If it deletes a project, return true, if the project doesn’t exist, return false. If false, then I can determine why I’m trying to delete a project that doesn’t exist.
@Simeon One thing I noticed, when I tap on a project name and select to delete it, it seems to take a long time. I tried it several times and it seems a lot longer. This is when 2 iPads would be nice, one on the beta, one on the last release.
@Simeon I did the export of all my projects. On the iPad I tried to look at the zip file with a zip viewer. I see all of my projects in a list as projectname.codea. When I select a project, I see a info.plist and Main.lua file. When I look at either of them, I see nothing. I found 2 png files and when I selected them, I see the correct images. Not sure why I can see the images, but not any text when I look at the project files.
@dave1707 thank you for the feedback. I better look into the Air Code issue.
I purposefully made createProject and deleteProject throw runtime errors in those circumstances. I considered that they are fairly powerful functions and by throwing errors we can hopefully ensure that code is using them correctly.
The solution I envisioned was as you said, use listProjects to check if a project exists. But I think we need to have a function to check. Something like projectExists(name)
Then you could say:
if projectExists(name) then
deleteProject(name)
createProject(name)
else
createProject(name)
end
(Or whatever you want to do.)
The function projectExists could be written now in terms of listProjects, but I agree that you shouldn’t have to write that just to use the project management API.
Also note there is a kind of “secret” feature exposed under the new project management API.
If you create a project with a non-existent collection, that collection will be created and it should show as a separate section in the project browser UI.
For example, createProject("Libraries:My Library") will add a new section to the main UI called “Libraries” with the project in it. The project collections feature will be exposed properly in the main UI in a future update, but for now it can be used through the API.
These projects are stored in your documents as Documents/<Collection Name>.collection/<Project Name>.codea
@Simeon I think the projectExists function would be perfect. It would be use just like you show above and the create and delete project functions wouldn’t have to be changed.
I have had some problems with the Project Archive, which I’ll go into later (as I am currently installing 10.2.1 and will retest then) … but I have just being trying to access my pad by Aircode for editing a simple program and when I click on the program icon in Firefox the iPad drops back to the ‘desktop’ screen.
Thanks for the reply, I got a black screen when I first loaded up the template when I was on iOS 10.2 switching to another program resulted in the crash, now I have 10.21 and I’m getting a black screen with any program - totally hooked up (p.s. also updated to the latest Firefox - so where the change is I’m not sure.