Howdy, Stranger!

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

Is there a way to transfer passages from one document to another?

If I created some passages in one document, is there I way I can export them into another document? I've got my work spread out between two different documents and I'd like to merge them into one. Is that possible?

Comments

  • There is no built-in way to copy passages from one Story Project into another, and currently if you are using the installable release of the application then it may also be difficult to have two story projects open at the same time so cut-n-pasting between project may not work.

    There are a number of ways you can manually insert the passage from one project into another, depending on if you are using the installable release of the application, your ability to use a Text Editor and/or Scripting languages.

    1. Using a Text editor:

    If you are using the installable release then all your story projects are saved on your local hard-drive as text files with a HTML file extension, the directory/folder these files are stored in can be accessed via the Twine > Show Library menu options.

    warning: You should make a backup copy of any project HTML you plan to work on in case something goes wrong, or you could lose your project.

    If you open a project HTML you will see it is made up of a number of HTML looking elements which represent the Story Javascript, the Story Stylesheet, and the individual Passages of your story project.
    The structure is something like the following, although I have added indents and line-breaks to make it more readable:
    <tw-storydata name="Adventures of John" startnode="1" creator="Twine" creator-version="2.0.10" ifid="86ED1017-7B60-4AFC-9D5A-41164B71F626" format="Harlowe" options="" hidden>
    	<style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css">
    		... Contents of the Story Stylesheet area ...
    	</style>
    	<script role="script" id="twine-user-script" type="text/twine-javascript">
    		... Contents of the Story Javascript area ...
    	</script>
    
    	<tw-passagedata pid="1" name="Into" tags="" position="503,450">
    		... Contents of the Into passage ...
    	</tw-passagedata>
    	<tw-passagedata pid="2" name="Character Description" tags="" position="644,454">
    		... Contents of the Character Description passage ...
    	</tw-passagedata>
    	<tw-passagedata pid="3" name="Day 1" tags="" position="646,579">
    		... Contents of the Day 1 passage ...
    	</tw-passagedata>
    
    	... More tw-passagedata elements ...
    
    </tw-storydata>
    
    note: that the pid attribute of each tw-passagedata element is one greater than the element before it, this is important because no two tw-passagedata element should have the same pid value.

    So you could manual copy the parts of one project file into the relevant sections of another, although you need to be careful you place things in their correct place and that you re-number the pid attributes of tw-passagedata elements you insert.

    2. Using a Scripting language:
    You could write code to do the above manual steps but you still need to be careful where you place things in the output file and to re-number the pid's.
  • Thanks. I'll try that. :)
Sign In or Register to comment.