[Tool] Trial Code Export Bookmarklet

Learn how to use AAO by reading tutorials, and seek help from the AAO community.

Moderator: EN - Forum Moderators

Post Reply
User avatar
Ferdielance
Posts: 778
Joined: Sun Mar 09, 2008 12:46 am
Gender: Male
Spoken languages: English

[Tool] Trial Code Export Bookmarklet

Post by Ferdielance »

v5's editor had a built-in trial data window during saving, but v6 doesn't - probably because the files get pretty verbose, and the automatic and manual backups in v6 are much more sophisticated.

But what if you want to duplicate a trial? What if you want to make more than 5 manual backups? What if you want to poke around in the trial data?

I've written a Javascript bookmarklet, based on Eli Grey's FileSaver.js, that allows you to export any trial's data to your hard drive with one click in the player. You can then use the trial restoration tool (http://aceattorney.sparklin.org/V6_Test/save.php) to restore your trial or make a copy (by starting an empty trial than replacing its content).

Warnings:

* This tool is not official, and not supported by Unas. Use at your own risk.
* In general, don't run random Javascript bookmarklets. I've been around this community long enough that I think people will trust me with this, though.

Firefox Instructions:

1: Open the Firefox bookmark toolbar. If it isn't visible, try right clicking the bookmark (star) icon and clicking "Bookmarks Toolbar."

2: Copy the code below (control-V)

Code: Select all

javascript:%20(function(){var%20jsCode=document.createElement('script');%20jsCode.setAttribute('src','http://www.ferdielance.com/FileSaver3.js');%20document.body.appendChild(jsCode);}());
3: Right-click on the bookmarks toolbar and paste that code. Yes, paste it right into the bookmark toolbar, even though there's no text box there. It'll work.

4: A new button should appear. If you like, you can rename the bookmark by right-clicking on it.

5: Open the trial you want to back up in the v6 player. Click the new bookmark.

The first piece of the trial data is a version identifier. The rest is a big JSON object converted into a string. One useful tool for poking around that data is here: http://jsonviewer.stack.hu/

Enjoy!
"A slow sort of country!" said the Queen. "Now, here, you see, it takes all the running you can do, to keep in the same place. If you want to get somewhere else, you must run at least twice as fast as that!"
callieG
Posts: 10
Joined: Sun Dec 18, 2022 4:04 pm
Spoken languages: English

Re: [Tool] Trial Code Export Bookmarklet

Post by callieG »

For anyone running into an issue where pressing the bookmark doesn't do anything:
  • Follow Steps 1 - 4 listed above.
  • Download a bookmarklet extension on Firefox, called "Bookmarklets Context menu" by Mems. Then open the editor for the trial you want to export.
  • Click on the extension. (If you can't see it, click on the general 'Extensions' button in the top right of Firefox - it looks like a puzzle piece. The extension should be visible in the dropdown)
  • Once clicked, the extension will show the javascript bookmarklet. Click on it, and it should prompt you to name the file. Name it (or don't - it'll save as 'download.json').
To import it into a new trial:
  • Write the new trial's ID in the 'ID of the trial to save:' box.
    Copy & paste the contents of the json file into the 'Contents of the trial file:' box.
Then you should be good to go.
Post Reply