iA / Writer / サポート / ヘルプ

URLコマンド

現在は、URLコマンドよりもApple Shortcutsの使用をおすすめしています。macOS 13 Ventura、iPadOS 16.1、iOS 16.1のいずれかでiA Writer 7.1をお使いなら、Shortcuts Gallery から始めてください。

URLコマンドを使うと、macOSとiOSのほかのアプリからiA Writerを開き、起動時に特定の操作を実行できます。

たとえば、テキストの断片を新しいiA Writerの書類に変換できます。URLコマンドは、iA Writerの既定設定の一部を変更する用途にも使えます。

概要

特別なURLを組み立てることで、iA Writerにコマンドを渡せます:

ia-writer://command?parameter1=value1¶meter2=value2

x-callback-url

すべてのコマンドは x-callback-url に対応しています:

ia-writer://x-callback-url/command?x-parameter1=x-value1¶meter1=value1¶meter2=value2

一部のコマンドは x-success でパラメータを返します。

認証

プライバシーとセキュリティのため、x-callback-urlでデータを変更または返却するコマンドには auth-token パラメータが必要です。認証トークンはiCloud経由で全デバイスに同期されます。認証トークンの確認場所は次のとおりです:

データ型

String
パーセントエンコード済み。エンコード前で4,000文字以下。
Library Path
パーセントエンコード済み。
/File.txt は、既定の場所(iCloudまたはローカル)にあるファイルを指します。
Ideas: File.txt は、Ideasという名前のカスタムLibrary Locationにあるファイルを指します。
From Other Apps: File.txt はiOSで利用できます。
LibraryとOrganizerのコンテクストメニューでパスをコピーできます。
Boolean
true または false のいずれかです。
Author
パーセントエンコード済み。たとえば AIChatGPT です。

Interface Commands

Open a screen in iA Writer.


open command

Opens Editor with an existing document if found, or a new empty document.

Parameters
path
Library Path. Required.
edit
Boolean。任意。iOSとiPadOSのみ対応。既定は falsetrue にするとキーボードが表示されます。
new-window
Boolean。任意。macOSのみ対応。既定は falsetrue にすると書類を新しいウィンドウで開きます。
Return parameters on x-success

None.


new command

Opens Editor with a new document.

Parameters
path
Library Path。任意。作成するファイルのパス。省略すると、既定の場所のルートに作成されます。パスがディレクトリを指す場合は、ファイル名が自動的に付けられます。ファイルを指す場合は、プレーンテキストの拡張子が必要です。そうでない場合、そのパスは無視されます。提案されたファイル名は使用されますが、既存ファイルを上書きしないように調整されます。
text
String。任意。ファイル内容。
edit
Boolean. Optional. Supported only on iOS and iPadOS. false by default. If true, keyboard will be shown.
new-window
Boolean. Optional. Supported only on macOS. false by default. If true, will open the document in a new window.
author
Author。任意。
Return parameters on x-success

なし。


Opens Quick Search with a given query.

Parameters
query
String. Optional.

Return parameters on x-success

None.


Data Commands

Silenty read and write data.


read command

Reads and returns files contents.

Parameters
auth-token
String. Required.
path
Library Path. Required. Path to the file to read.

Return parameters on x-success

path
Library Path. Path to the file.
text
String. File text.

write command

Creates or modifies an existing file and returns file contents.

Parameters
auth-token
String. Required.
path
Library Path. Required.
text
String. Optional.
mode
String. Optional.
create Default. Adjusts last path component to avoid replacing an existing file.
replace Replaces an existing file.
add Add the given text to an existing file; creates a file if it doesn’t exist.
patch Detects differences between the and file contents and text, and attributes edits to author, if provided.
add-location
String. Optional. Used only when mode is append.
beginning Add text at the beginning of a file.
end Default. Add text at the end of a file.
add-padding
String. Optional. Used only when mode is append.
sentence Add text as a sentence.
line Default. Add text as a line.
paragraph Default. Add text as a paragraph.
author
Author. Optional.

Return parameters on x-success

path
Library Path. Path to the file that was created or modified.
text
String. File contents after writing.

version command

Returns iA Writer app version and URL scheme version.

Parameters

None.

Return parameters on x-success

scheme-version
String. URL scheme version.
app-version
String. App version.

Version History

1
Initial release.
2
Fixed write command parameter append-padding. It was inverted in version 1: padding was appended with false, and not appended with true.
3
Changed write command with mode=append to create a file if it doesn’t exist.
4
Added open and new command parameter new-window.
Changed open command to open a new empty file if file at path is not found.
Changed write command to create target folder if it doesn’t exist.
Renamed Path data type to Library Path, and updated the data type format. Old format is deprecated.
5
Added author parameter support to write command.
6
Added author parameter support to new command.
Adjusted write command with mode=append
Renamed mode=append to mode=add, append-location to add-location and append-padding to add-padding.
Added support for add-padding values sentence and line. paragraph remains default.
Added write command mode=patch.
Adjusted read command to avoid returning authorship.

ヘルプ