tag:support.primatelabs.com,2011-01-31:/discussions/voodoopad/29627-convert-all-pages-in-documentPrimate Labs: Discussion 2020-02-02T23:02:35Ztag:support.primatelabs.com,2011-01-31:Comment/479616662020-01-03T03:37:30Z2020-01-03T03:37:30ZConvert all pages in document<div><p>The item conversion code is gnarly and isn't exposed through the scripting interface, so there's currently no way to convert items from one format to another via a script.</p></div>Johntag:support.primatelabs.com,2011-01-31:Comment/479616662020-01-03T14:02:15Z2020-01-03T14:02:16ZConvert all pages in document<div><p>That would certainly explain why I had trouble figuring it out. Thanks! How about being able to tell from a script which format a page is in, so I don’t have to manually walk through every page to check?</p></div>Erik Ackermantag:support.primatelabs.com,2011-01-31:Comment/479616662020-01-13T06:02:37Z2020-01-13T06:02:37ZConvert all pages in document<div><p>You can call <code>uti()</code> on an item to determine its type:</p>
<pre>
<code>var item = document.pageForKey(itemName);
print(item.uti());</code>
</pre>
<p>You'll get a UTI back (e.g., <code>public.utf8-plain-text</code>) rather than a straightforward type name, but text pages generally only have a handful of types:</p>
<ul>
<li><code>com.apple.rtfd</code></li>
<li><code>net.daringfireball.markdown</code></li>
<li><code>public.utf8-plain-text</code></li>
</ul></div>Johntag:support.primatelabs.com,2011-01-31:Comment/479616662020-01-13T11:43:13Z2020-01-13T11:43:13ZConvert all pages in document<div><p>Perfect! Thank you.</p>
<p>Erik</p></div>Erik Ackermantag:support.primatelabs.com,2011-01-31:Comment/479616662020-02-02T23:02:31Z2020-02-02T23:02:34ZConvert all pages in document<div><p>Before you do this, have a backup of two of your existing Vodoopad document(s) in case they are corrupted after the conversion.</p></div>Kent Sandvik