Assist Help

Assists are special bookmarks that you can open from DraftPad to route your text to other apps or web services. For example, you can search with Google website directly from DraftPad using your text as the keyword, or you can post to Twitter from DraftPad with/without using other Twitter client apps.

Assists can be imported from the Assist Library webpage which can be accessed from the Assists list screen in your DraftPad. Every pre-installed Assist is stored in the Assist Library, so please feel safe to delete ones from your Assists screen because you can import it again from the library anytime later.

You can modify existing Assists to make them suit to your tasks, or you can even make your own ones.

Customizing an Assist

Assists are customizable. To modify existing Assist, tap "Edit" button on the Assists list screen and select an item you want to edit.

There are three things you can change, the Title, URL, and Option.

The Title doesn't affect the functionality of an Assist. So you can change it as you like.

The URL is specifying the functionality of an Assist itself. So you have to be careful to touch it. However, if you see one or more placeholders such as "<@>," "<@L1>," or "<@@>" within the URL string, it's not bad to replace them with other placeholders to make the Assist more useful to you.

For example, let's edit the "Tweet" Assist. The URL string is like this.

draftpad://twitter/update?text=<@>

You see a placeholder "<@>" at the end. This placeholder means "Current line or selection of your text." Actually, this Assist posts the current line or the selection of your text to Twitter. Now, if you prefer to post the whole text instead of the current line, replacing "<@>" with "<@@>" makes it possible. The placeholder "<@@>" means "Whole text."
To learn more about placeholders, see the "Placeholders" section below.

The Option is another chance to customize the functionality of an Assist. Option specifies how DraftPad copies, cuts, or clears your text when an Assist is being executed.
In most of the Assists, Option is set as "None" by default. This means that the written text is not going to be changed when the Assist is executed. For example when you execute the "Tweet" Assist, DraftPad sends your text to Twitter server, but the sent string will be still on the text view. Now if you prefer that the sent string is removed automatically from the text view (because you don't need it anymore), choosing "Clear Current Line or Selection" in the Option menu makes it possible.

Creating an Assist

If you are familiar with web technology, creating your own Assist is not a big deal.
Still, you need to learn about the composition of Assist. Let's talk about the three attributes such as "Title," "URL," and "Option."

Title

As mentioned above, you can name each Assist as you like. The title will be shown in the Assists list.

URL

The format of Assist URL is just like that of Internet URL, but the one big difference is that - you can use special placeholder(s) within the URL string, so that your text on the text view can be a part of the URL dynamically, and it can be passed to another app or a web service.

The most typical way to make an Assist URL by yourself is to find and reuse the URL which is requested when you submit your input on your favorite web service. For example, when you hit the Search button in Google with mobile Safari, the URL which is like "http://www.google.com/search?q=yourKeyword" will be sent to the Google server. In this case, the string "yourKeyword" is what you are searching for. So modifying this URL as an Assist URL like below makes your DraftPad an interface for Googling.

Example URL 1:
http://www.google.com/search?q=<@>

Example URL 1 shows a URL which allows you to search with Google via Safari app by using your text as the searching keyword(s). In this case, "<@>" is the placeholder that means "replace me with the text from current line or selection." When you execute this Assist, DraftPad will make a URL string like "http://www.google.com/search?q=yourText" then opens Safari app by passing the URL to request Google to show the search results. Your text string will be URL-encoded automatically to be a part of an appropriate URL.

Example URL 2:
twitterrific:///post?message=<@>

Example URL 2 shows the Assist URL which allows you to tweet with Twitterrific app by using your text as the sending message. In this case, the prefix "twitterrific://" means that the iOS will open Twitterrific app when this URL is invoked if that app is installed in your device, and "/post?message=" is one of the predetermined APIs of Twitterrific app. When Twitterrific app receives a URL which is like "twitterrific:///post?message=yourText" from another app, Twitterrific app will show its message composer with the passed text in it, and you are ready to tweet. Many apps have their own APIs (OpenURL schemes). Check the documents of your favorite apps or ask their support to know what/how you can do with those APIs.

Placeholders

Assist URL accepts several kinds of placeholders. You can put them multiple times within one URL if you want to.

Markups for placeholding
<@> Current Line or Selection.
<@L1> 1st Line. Any number can be used.
<@L1~> From 1st Line to the End. Any number can be used.
<@L1~2> From 1st Line to 2nd Line. Any numbers can be used.
<@L~3> Up to 3rd Line. Any number can be used.
<@-L1> The last 1 line. Count backward from the end of the text. Any number can be used. Available with DraftPad v1.6+.
<@C1> 1st Character. Any number can be used.
<@C1~> From 1st Character to the End. Any number can be used.
<@C1~2> From 1st Character to 2nd Character. Any numbers can be used.
<@C~3> Up to 3rd Character. Any number can be used.
<@-C1> The last 1 character. Count backward from the end of the text. Any number can be used. Available with DraftPad v1.6+.
<@@> Whole Text
<#LOC> The number representing current cursor position. If the cursor is at the beginning of the text, this placeholder will be replaced with "0″. Available with DraftPad v1.4+.
<#LEN> The number representing current length of the selection. If the string "Hello" is currently selected in the text view, this placeholder will be replaced with "5″. Available with DraftPad v1.4+.

Text Encoding

The string which is replaced by using the placeholders will be percent-encoded (URL-encoded) by UTF-8 base. This means that the string must be decoded by UTF-8 base by the receiver to be processed correctly.
However some services, such as a Japanese website for example, are designed to decode parameters within the received URL by using other encodings, like Shift-JIS for example. In such cases, the Assist doesn't work because you can't pass the correct string to the receiver.
To solve this problem, DraftPad v1.4+ has a feature to specify the text encoding base.

To specify the text encoding base, put one of the special markups, listed below, at the head of an Assist URL string.

Sample: specifying the text encoding as Shift-JIS base
<€3>http://cosmeet.cosme.net/top/search?fw=<@>
Markups for specifying text encoding base
(None) UTF8
<€0> UTF8
<€1> Western (ISO Latin 1)
<€2> Western (Mac OS Roman)
<€3> Japanese (Shift JIS)
<€4> Japanese (ISO 2022-JP)
<€5> Japanese (EUC)
<€6> Japanese (Shift JIS X0213)
<€7> Traditional Chinese (Big 5)
<€8> Traditional Chinese (Big 5 HKSCS)
<€9> Traditional Chinese (Windows, DOS)
<€10> Korean (ISO 2022-KR)
<€11> Korean (Mac OS)
<€12> Korean (Windows, DOS)
<€13> Arabic (ISO 8859-6)
<€14> Arabic (Windows)
<€15> Hebrew (ISO 8859-8)
<€16> Hebrew (Windows)
<€17> Greek (ISO 8859-7)
<€18> Greek (Windows)
<€19> Cyrillic (ISO 8859-5)
<€20> Cyrillic (Mac OS)
<€21> Cyrillic (KOI8-R)
<€22> Cyrillic (Windows)
<€23> Ukrainian (KOI8-U)
<€24> Thai (Windows, DOS)
<€25> Simplified Chinese (GB 2312)
<€26> Simplified Chinese (HZ GB 2312)
<€27> Chinese (GB 18030)
<€28> Central European (ISO Latin 2)
<€29> Central European (Mac OS)
<€30> Central European (Windows Latin 2)
<€31> Vietnamese (Windows)
<€32> Turkish (ISO Latin 5)
<€33> Turkish (Windows Latin 5)
<€34> Central European (ISO Latin 4)
<€35> Baltic (Windows)

Option

"Option" is to specify how DraftPad copies, cuts, or clears your text when an Assist is being executed. There are seven choices.

None DraftPad does nothing.
Copy Current Line or Selection DraftPad will copy the text from the current line or the current selection right before executing the Assist.
Copy All Text DraftPad will copy the whole text right before executing the Assist.
Cut Current Line or Selection DraftPad will cut the text from the current line or the current selection right after executing the Assist.
Cut All Text DraftPad will cut the whole text right after executing the Assist.
Clear Current Line or Selection DraftPad will remove the text of the current line or the current selection right after executing the Assist.
Clear All Text DraftPad will clear the whole text right after executing the Assist.