Foldit has a built-in recipe editor, but it has extremely limited function. For example, the Foldit recipe editor lacks the search/replace functions found in simple editors like Windows Notepad.

Many Foldit LUA recipes are hundreds of lines long. Recipes of this size and complexity require a more full-featured editor.

This article describes the process for exporting an existing recipe, modifying the recipe, and importing the modified recipe under a new name. The examples in this article were created under Windows.

See also Little Square Boxes (LSB) for a discussion of how to fix and avoid control characters in Foldit recipes. The control characters show up as little square boxes when viewed in the Foldit recipe editor.

Quick SummaryEdit

The steps involved in updating a recipe are illustrated in detail in the sections below. This section provides a quick summary with no illustrations.

The first step is to export an existing recipe.

  1. Open the recipe in the Foldit recipe editor
  2. Click "Save As" in the recipe editor toolbar
  3. In the Foldit "Save As" dialog, click "Export"
  4. In the OS-specific "Save As" dialog select a name and location for the recipe file

Note: as detailed in the discussion of Little Square Boxes (LSB), if the recipe shows little square boxes at the end of each line in the Foldit recipe editor, it's better to copy the recipe and paste into the editor of your choice. The next step is to edit the recipe with the editor of your choice.

After updating the recipe, the final step is to import the modified recipe into Foldit. The recipe can then be tested and shared. The process listed here preserves the parent/child relationship of the old and new versions of the recipe.

  1. Open the existing recipe in the Foldit recipe editor
  2. Click "Save As" in the recipe editor toolbar
  3. In the Foldit "Save As" dialog, change the recipe's name and description, and click "OK"
  4. The existing recipe has now been copied and renamed
  5. With the newly renamed recipe still open in the Foldit recipe editor, click "Load"
  6. In the "Load" dialog, click "Import"
  7. In the OS-specific file open dialog, select the modified recipe file
  8. In the Foldit recipe editor, verify the correct version was imported, and click "Save"
  9. The new version of the recipe is now available in the Foldit cookbook

For a completely new recipe, the import process is similar.

  1. In the Foldit recipe editor, click "New (Script V2)" from the toolbar
  2. (You may be prompted to save or discard any pending recipe changes at this point)
  3. The Foldit recipe editor displays a clean screen
  4. Follow steps 5-9 of the update procedure above

Exporting an existing recipeEdit

To change an existing recipe, open the recipe in the Foldit recipe editor, then use "Save As" and "Export" to save the recipe source code in a file.

Edit recipeEdit

In the Foldit cookbook, highlight an existing recipe, for example "TvdL Enhanced DRW 2.4.1". Click on the notepad icon to edit the recipe.

Edit Recipe 001a

Edit recipe

Save AsEdit

The Foldit recipe editor opens and displays the recipe. Select "Save As" from the toolbar.

Edit Recipe 010

Save As


On the "Save As" dialog, select "Export". (This dialog doesn't have a title bar, so you won't see "Save As" at the top.)

Edit Recipe 003


Create External fileEdit

As OS-specific "Save As" dialog such as the one shown here should appear. Select a folder/directory for the file, and give the file a name. Use the suffix ".lua" to indicate the file is a LUA source file.

Click "Save" to save the file to the specified location.

Edit Recipe 004

Save as dialog

Editing the recipeEdit

After exporting the recipe, a suitable editor can be used to make changes. The "vim" editor is used in these examples.

As a suggested first step, locate the version number in the recipe. Consider adding a version number if there isn't one already. The "TvdL Enhanced DRW 2.4.1" prints the version number in several spots.

Edit Recipe 007

Version 2.4.1

After changing the version number, save the recipe under a new name. Alternately, copy the original recipe to a new file before editing.

Edit Recipe 008

Version updated to 2.4.2

Importing the modified recipeEdit

The modified recipe can be imported using the Foldit recipe editor. For changes to an existing recipe, first save the existing recipe with a new name, then import the modified recipe and save this version under the new name. Saving the existing recipe under a new name first preserves the parent/child relationships of the recipe when the new version is shared in Foldit.

For new recipes, simply select "New (Script V2)" in the Foldit recipe editor and import the recipe as outlined below. When the new recipe is shared in Foldit, it won't have a parent recipe.

Save AsEdit

Open the existing recipe again in the Foldit recipe editor, and click "Save As". This time, the goal is to give the recipe a new name in Foldit instead of exporting it.

Edit Recipe 010

Save As

Modify recipe infoEdit

In the "Save As" dialog, modify the recipe title and description. Click "OK". The original recipe has now been saved with a new name. This step ensures the original recipe will be the parent of the new version when the new version is shared in Foldit.

Edit Recipe 011

Save As


In the Foldit recipe editor, with the renamed recipe still open, click the "Load" button on the toolbar.

Edit Recipe 013

Save As


In the Load dialog, click "Import".

Edit Recipe 012

Save As

Open fileEdit

After clicking "Import", an OS-specific open file dialog is displayed. Select the modified recipe file.

Edit Recipe 014

Open dialog


Verify the correct version was imported. In this example, the modified recipe version was the only change. Click "Save" to save the new version to the Foldit cookbook.

Edit Recipe 015


New version displayed in cookbookEdit

The new version of the recipe appears in the Foldit cookbook. Hovering over the recipe displays the modified description.

Edit Recipe 016

Modified recipe

Community content is available under CC-BY-SA unless otherwise noted.