Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

TabGrabInator: another tool to use after the bug fix

edited June 2021 in Code Sharing Posts: 1,629

A tool for editing dependencies without having to change projects.

Use 'get' to import a single tab; then make your edits; then use 'putBack' to put it back.

The dependency will now use your new code.

You can also get and put back multiple tabs from different projects all at once.

Just use 'getMultiple' with a table that follows this structure:

tableParameter = { [project1Name] = { tabName1, tabName2, ... etc }, [project2Name] = { tabName1, tabName2, ... etc }, ... etc }

NOTE: be sure to be on the Main tab before running any of the putBack commands. Codea doesn't like it when you are currently on a tab when that tab is deleted.

But again, this relies on the readProjectTab and saveProjectTabfunctions, which seem to have been causing trouble.

Personally I plan to use this a lot, but buyer beware.

The demo project here should be self-explanatory but let me know if it’s confusing.

update: changed the name to TabGrabInator



  • edited June 2021 Posts: 1,298

    crashes when i press gettab button. what am i missing?

    DependencyAccessInator:19: Project tab "dependencyTestFunction" not found
    stack traceback:
        [C]: in function 'readProjectTab'
        DependencyAccessInator:19: in field 'get'
        Main:23: in function 'getTab'
  • Posts: 1,629

    @RonJeffries Crashes? I haven’t seen that. You need to designate the other two files as dependencies, did you do that? Sorry if that wasn’t clear—I thought they would already be linked since they were when I zipped them.

  • Posts: 1,629


    Replace these functions:

    function getTab() DependencyAccessInator.get("DependencyTest", "dependencyTestTab") end function putBackTab() DependencyAccessInator.putBack("DependencyTest", "dependencyTestTab") end
  • Posts: 1,629

    @RonJeffries I’ve updated the zip now, with those changes.

  • Posts: 1,298

    after putting back multiple tabs, if i then exit the program, codea crashes to the desktop. i don't see why the thing wouldn't work, but it's deadly.

  • Posts: 1,629

    @RonJeffries that’s not a result I’m seeing, either on iPhone 8 or on a 12 inch iPad Pro.

    Does it happen just after tapping “put back” once?

    But yeah Codea seems to bug out around this tab-reading-and-saving stuff, hence the title of this thread.

  • Posts: 1,629

    @RonJeffries scratch that, I am seeing it on iPhone, just not iPad.

    For me, I have to actually change the tabs before putting them back to make it crash; if I don’t make changes the tabs are fetched and put back no problem—same for you?

    If it happens on iPhone but not iPad, does that give you any sense of what it could be?

  • Posts: 1,629

    @RonJeffries I think I have it.

    The problem happens when you start running the program while you’re on a tab that gets deleted when you tap “put back”.

    It seems like Codea freaks out when you try to exit the program to a tab that’s not there anymore.

    Please try making changes to the tabs and then being sure to be on the Main tab before you run the program and tap the “put back” button.

    Please let me know if that prevents the crash for you, as it does for me..

  • Posts: 1,298

    probably it. will let you know if i try it again.

  • Posts: 1,629

    @RonJeffries I’m trying to think of a way to enforce people being on the Main tab before putting back tabs. Can you think of anything?

  • Posts: 1,298


  • Posts: 1,629

    @RonJeffries I’ve added a primitive thing I called the EnforceInator that requires explicit confirmatory action before letting any of the putBack functions proceed.

    It doesn’t prevent someone from doing the things that cause the crash, but at least it informs them how to avoid it.

    It’s not great, but it’s something, which seems like my programming mantra of late.

Sign In or Register to comment.