JavaScript Support(JavaScriptへの対応)

  1. Introduction(導入)
    1. JavaScript in Tasks(タスク内のJavascript)
    2. Embedded in HTML(HTMLに埋め込む)
  2. Local Variables(ローカル変数)
  3. Global Variables(グローバル変数)
  4. Arrays(配列)
  5. Settings(設定)
  6. Execution(実行)
    1. Execution Instances(実行インスタンス)
    2. Working Off-Device(デバイス外での作業)
    3. 1. JavaScript action(JavaScriptアクション)
    4. 2. Using WebView(ウェブビュー要素を使う)
    5. Builtin Function Execution(組み込み関数の実行)
    6. JavaScript(let): Alert,Confirm,Prompt(Javascript(let):警告、確認、入力ダイアログの表示)
    7. JavaScript(let): Auto Exit(Javascript(let):自動実行)
    8. JavaScript(let): Libraries(Javascript(let):ライブラリ)
  7. Builtin Functions(組み込み関数)
      1. alarmVol / btVoiceVol / callVol / dtmfVol / mediaVol / notificationVol / systemVol / ringerVol(アラーム音量、ブルートゥース音声の音量、通話音量、発信音量、メディア音量、通知音量、システム音量、呼び出し音量)
      2. audioRecord(録音)
      3. audioRecordStop(録音停止)
      4. browseURL(URLのブラウズ)
      5. button(ボタン)
      6. call(電話をかける)
      7. callBlock(着信拒否)
      8. callDivert(着信転送)
      9. callRevert(着信の再開)
      10. carMode(車載モード)
      11. clearKey(暗号キーを消去する)
      12. composeEmail(Eメールの作成)
      13. composeMMS(MMSの作成)
      14. composeSMS(SMSの作成)
      15. convert(変換)
      16. createDir(ディレクトリの作成)
      17. createScene(シーンの作成)
      18. cropImage(画像のトリミング)
      19. decryptDir(ディレクトリの復号化)
      20. decryptFile(ファイルの復号化)
      21. deleteDir(ディレクトリの削除)
      22. deleteFile(ファイルの削除)
      23. destroyScene(シーンの破棄)
      24. displayAutoBright(画面の明るさを自動調節)
      25. displayAutoRotate(画面の自動回転)
      26. displayTimeout(消灯時間)
      27. dpad(Dパッド)
      28. enableProfile(プロファイルの有効化)
      29. encryptDir(ディレクトリの暗号化)
      30. elemBackColour(要素の背景色)
      31. elemBorder(要素の境界線の色)
      32. elemPosition(要素の位置)
      33. elemText(要素の文字)
      34. elemTextColour(要素の文字色)
      35. elemTextSize(要素の文字サイズ)
      36. elemVisibility(要素の可視性)
      37. endCall(通話終了)
      38. encryptFile(ファイルの暗号化)
      39. enterKey(キーの入力)
      40. filterImage(画像のフィルタリング)
      41. flipImage(画像の反転)
      42. exit(終了)
      43. flash(フラッシュ)
      44. flashLong(長めのフラッシュ)
      45. getLocation(位置情報の取得)
      46. getVoice(音声認識)
      47. goHome(ホーム画面に戻る)
      48. haptics(触覚)
      49. hideScene(シーンを非表示)
      50. global(グローバル変数)
      51. listFiles(ファイルの列挙)
      52. loadApp(アプリの読み込み)
      53. loadImage(画像の読み込み)
      54. lock(ロック画面)
      55. local(ローカル変数)
      56. mediaControl(メディアの制御)
      57. micMute(マイクの消音)
      58. mobileData(モバイルデータ通信)
      59. musicBack(早戻し)
      60. musicPlay(音楽の再生)
      61. musicSkip(早送り)
      62. musicStop(再生の停止)
      63. nightMode(夜間モード)
      64. popup(ポップアップ表示)
      65. performTask(Taskの実行)
      66. profileActive(プロファイルのアクティブ状態)
      67. pulse(バイブレーション)
      68. readFile(ファイルの読み込み)
      69. reboot(再起動)
      70. resizeImage(画像のリサイズ)
      71. rotateImage(画像の回転)
      72. saveImage(画像の保存)
      73. say(読み上げ)
      74. sendIntent(インテントを送る)
      75. sendSMS(SMSを送る)
      76. setAirplaneMode(機内モードの設定)
      77. setAirplaneRadios(機内通信の設定)
      78. setAlarm(アラームの設定)
      79. setAutoSync(自動同期の設定)
      80. scanCard(メモリーカードの読み取り)
      81. setBT(ブルートゥースの設定)
      82. setBTID(ブルートゥースIDの設定)
      83. setGlobal(グローバル変数の設定)
      84. setKey(暗号キーの設定)
      85. setLocal(ローカル変数の設定)
      86. setClip(クリップボードの設定)
      87. settings(設定)
      88. setWallpaper(壁紙の設定)
      89. setWifi(WiFiの設定)
      90. shell(シェルコマンド)
      91. showScene(シーンの表示)
      92. shutdown(シャットダウン)
      93. silentMode(サイレントモード)
      94. sl4a(SL4Aスクリプト)
      95. soundEffects(サウンドエフェクト)
      96. speakerphone(スピーカーフォン)
      97. statusBar(ステータスバー)
      98. stayOn(充電時の端末の電源)
      99. stopLocation
      100. systemLock(システムのロック)
      101. taskRunning(実行中のタスク)
      102. takeCall(電話に出る)
      103. takePhoto(写真を撮る)
      104. type(入力)
      105. unzip(解凍)
      106. usbTether(テザリングの使用)
      107. vibrate(振動)
      108. vibratePattern(振動パターン)
      109. wait(待機)
      110. wifiTether(WiFiテザリング)
      111. writeFile(ファイルの書き込み)
      112. zip(圧縮)
  8. Notes
    1. Audio Streams(オーディオストリーム)
    2. Colours(色)
    3. File Paths(ファイルパス)

Introduction(導入)

Tasker supports running JavaScript code in tasks or WebView scene elements. Most Tasker actions can be accessed direct from the JavaScript. JSON and XMLHTTPRequest are also directly available from the JavaScript code.

https://tasker.joaoapps.com/userguide/en/javascript.html

Taskerはタスク内やシーンのウェブビュー要素でのJavascriptの実行をサポートしています。ほとんどのTaskerのアクションはJavascriptから直接アクセス可能です。JSONやXMLHTTPリクエストなども同様にJavascriptから操作できます。

JavaScript in Tasks(タスク内のJavascript)

JavaScript can be embedded inline in tasks via the JavaScriptlet (direct specification of JavaScript to run) or JavaScript (load script from file) actions.

In both cases, the JavaScript executes in sequence with the other actions in the task and variables are transparently converted so pieces of JavaScript can be interwoven throughout the task.

https://tasker.joaoapps.com/userguide/en/javascript.html

JavascriptはJavascriptletアクション(Javascriptのコードを直接記述して実行します)またはJavascript(スクリプトをファイルから読み込みます)アクションをつかってタスク内に設置できます。

いずれのケースでも、Javascriptはタスク内の他のアクション同様順次実行され変数も透過的に変換されるため、Javascriptを織り交ぜたタスクを作成できます。

Embedded in HTML(HTMLに埋め込む)

WebView elements allow specification of mixed HTML and JS for the element content.

<H1 onClick="setWifi( false )">ClickMeToTurnOffWifi</H1>

This allows a single WebView to present a complete user-interface.

https://tasker.joaoapps.com/userguide/en/javascript.html

ウェブビュー要素はその表示内容としてHTMLとJavascriptを併用することができます。

<H1 onClick="setWifi( false )">ClickMeToTurnOffWifi</H1>

これにより、単純なウェブビュー内で完全なユーザーインターフェースを提供できます。

<H1 onClick="setWifi( false )">ClickMeToTurnOffWifi</H1>

Local Variables(ローカル変数)

In JavaScript(let) actions, local variables (all lower case, e.g. %myvar) are directly accessible in the JavaScript without the % sign (e.g. myvar). If the script changes the value, the new value is transparently used by subsequent actions in the task.

The values of new (all lower case) variables declared in JavaScript (with the var keyword) are also available to subsequent actions, with the exception of those which are chain-declared e.g. var one = 'aval', two = 'bval';

In JavaScript embedded in HTML, the functions local and setLocal must be used to access variables local to the scene hosting the WebView.

If you’re using a JavaScript or JavaScriptlet action and you disable Auto Exit, you have to set local variables with setLocal.

https://tasker.joaoapps.com/userguide/en/javascript.html

Javascript(let)アクションにおいて、ローカル変数(全て小文字の変数名のもの。例:%myvar)には%を除いた変数名(例:myvar)で直接アクセスできます。スクリプトが変数の値を変更すると、タスク内の他のアクションでもその値を透過的に使用することができます。

同様に新しく(全て小文字で)Javascriptによって(varキーワードによって)定義された変数は、var one = ‘aval’, two = ‘bval’; のように連続して定義された変数を例外として続くアクション内での参照が可能です。

HTMLに埋め込まれたJavascriptでは、ウェブビューが設置されたシーンからは local や setLocal などの関数を用いてアクセスする必要があります。

「自動で終了する」パラメーターを無効にしてHTMLに埋め込まれたJavascriptアクションやJavascriptletアクションを使用する場合、ローカル変数をセットするためには setLocal 関数を使用する必要があります。

Global Variables(グローバル変数)

Tasker global variables need to be accessed via global() and set via setGlobal(). Global arrays are not supported due to an Android limitation.

https://tasker.joaoapps.com/userguide/en/javascript.html

Taskerのグローバル変数にアクセスするには global() 関数を使います。またグローバル変数のセットには setGlobal() 関数を使います。Androidの制限によりグローバル配列は使用できません。

Arrays(配列)

Local Tasker arrays are transparently available in Javascript(let)s and vice-versa. They are not available in WebViews.

Arrays which are not existing Tasker arrays must be declared in the JS as such i.e. in this case arr will not be visible to the remainder of the task:

	var arr = getSomeArray();

Whereas in this case it will:

	var arr = [];
	arr = getSomeArray();

Note that:

  • JavaScript array indices start at 0, whereas Tasker array indices start at 1
  • JavaScript uses [] while Tasker uses ()

So, for example, %arr(1) (Tasker) is equivalent to arr[0] (JavaScript).

https://tasker.joaoapps.com/userguide/en/javascript.html

Taskerのローカル配列はJavascript(let)アクションから透過的にアクセスでき、その逆もまた可能です。ウェブビュー要素内でのアクセスはできません。

Taskerの配列に存在しない配列は、Javascript内で以下の様に定義する必要があります。この場合、変数 arr は残りのタスクからは見えません。

	var arr = getSomeArray();

一方、このようにすれば見えます。

	var arr = [];
	arr = getSomeArray();

次の点に注意してください。

  • Javascriptの配列の添字(インデックス)は 0 から始まりますが、Taskerの配列の添字は1からです。
  • 配列を表すのにJavascriptでは [] を使いますが、Taskerでは()を使います。

したがって、Taskerでの配列要素 %arr(1) は、Javascriptでの配列要素 arr[0] に相当します。

Settings(設定)

Unlike normal Tasker actions, settings which are changed in JavaScript as part of a profile’s enter task are not restored when the profile exits.

https://tasker.joaoapps.com/userguide/en/javascript.html

通常のTaskerのアクションとは異なり、プロファイルの開始タスクの一部として実行されたJavascriptによって変更された設定はプロファイルが終了しても復元されません。

Execution(実行)

Execution Instances(実行インスタンス)

Only one script can execute at one time. Once a piece of JavaScript is executing, it cannot be interrupted by another piece.

https://tasker.joaoapps.com/userguide/en/javascript.html

一度に実行されるスクリプトは一つだけです。あるJavascriptコードが実行されるとそれ以外のコードによって中断されることはありません。

Working Off-Device(デバイス外での作業)

You might wish to develop long and/or complicated tasks off-device e.g. on a PC. There are two strategies for that:

https://tasker.joaoapps.com/userguide/en/javascript.html

長大で複雑なタスクをPCなど携帯端末以外の場所で作成したい場合、以下の二つの方法があります。

You might wish to develop long and/or complicated tasks off-device e.g. on a PC. There are two strategies for that:

1. JavaScript action(JavaScriptアクション)

For off-device testing, use Menu / More / Developer / Save JS Library Template to get dummy definitions for the built in functions. Include that file when developing on your PC.

To test in your JavaScript code whether you’re on-device or not, use

var onAndroid = ( global( 'sdk' ) > 0 );

By using the JavaScript action rather than JavaScriptlet you can easily access a file synced from PC to a file on the Android device.

https://tasker.joaoapps.com/userguide/en/javascript.html

端末外でのテストのために、メニュー / その他 / 開発者向けオプション / JSライブラリのテンプレートを保存する から組み込み関数のダミーの定義を保存します。開発用のPCでこのファイルを読み込みます。

Javascriptのコードで実行環境が端末なのかどうかを区別するには次のようにします。

var onAndroid = ( global( 'sdk' ) > 0 );

JavascriptletアクションよりもJavascriptアクションの方がPCによって同期されたAndroid端末上のファイルに容易にアクセスすることができます。

2. Using WebView(ウェブビュー要素を使う)

If you specify a website URL as the content for your WebView, then testing the code on the target device is a simple matter of pushing the new version to your webserver and reloading the WebView on the device (see action Element Web Control)

https://tasker.joaoapps.com/userguide/en/javascript.html

ウェブビュー要素の表示内容にウェブサイトのURLを指定し、ターゲットとなる端末でコードをテストするには、その都度修正したコードをサーバーにアップロードして端末でリロードする必要がある点に注意してください。(ウェブ制御アクションもご覧下さい)

Builtin Function Execution(組み込み関数の実行)

Calls to most Tasker builtin functions (see below) are executed as normal single-action tasks and thus may be blocked by other executing tasks.

They execute at the priority of the task that executed the JavaScript plus two.

https://tasker.joaoapps.com/userguide/en/javascript.html

Taskerの多くの組み込み関数(次の項を参照)の呼び出しは通常の単一アクションのタスクとして行われるため他の実行中のタスクによってブロックされることがあります。

これらはJavascriptアクションよりも二つ高い優先度で実行されます。

JavaScript(let): Alert,Confirm,Prompt(Javascript(let):警告、確認、入力ダイアログの表示)

Scripts using these functions require a ‘user-interface’ and may cause interference with the currently running app (though in most cases they will not).

https://tasker.joaoapps.com/userguide/en/javascript.html

これらの関数を使用するスクリプトにはユーザーインターフェースが必要であり、現在実行中のアプリと干渉を引き起こす可能性があります(とはいえほとんどの場合干渉しません)。

JavaScript(let): Auto Exit(Javascript(let):自動実行)

By default, the JavaScript(let) action will end when the main execution sequence is finished.

If you are using asynchronous code e.g. via setTimeout() or other callbacks, you should deselect Auto Exit. You are then responsible yourself for telling Tasker to continue the task by calling exit().

In any case, execution will stop when the timeout configured for the action is reached.

https://tasker.joaoapps.com/userguide/en/javascript.html

デフォルトでは、Javascript(let)アクションはもととなる実行シーケンスの完了と共に終了します。

setTimeout() 関数やその他のコールバックなど非同期のコードを実行している場合、自動終了の選択はできません。タスクの実行を継続するには exit() 関数を明示的に呼び出してTaskerに実行継続を知らせてやる必要があります。

いずれの場合でも、タイムアウトが設定された時間が経過すると実行は停止します。

JavaScript(let): Libraries(Javascript(let):ライブラリ)

You can specify as many libraries as you want in the Libraries parameter, separated by newlines.

Several popular libraries are pre-selectable.

You may wish to download them manually to your local storage and change the http URL to a file URL so that Internet is not required to run your script.

Warning: library code will have access to local files, data providers etc. on the device

Important: if you are using your own libraries developed on Windows, you may need to convert CRLF style line endings to Unix style LF.

https://tasker.joaoapps.com/userguide/en/javascript.html

ライブラリパラメーターには必要な数だけライブラリを改行区切りで設定できます。

いくつかの標準的なライブラリについては最初から選択状態となっています。

ローカルストレージに手作業でライブラリファイルをダウンロードしてHTTPのURLをファイルパスに変更することでスクリプトの実行時のインターネット接続を不要にできます。

警告:ライブラリは端末のファイルやデータにアクセスすることがあります。

重要:ウィンドウズ上で作成した独自ライブラリを使う場合、行末文字をCRLF形式からユニックスで使われるLF形式に変更する必要があります。

Builtin Functions(組み込み関数)

Tasker makes most of it’s actions available via functions which can be called directly via name in JavaScript(let) actions and WebView elements.

Exceptions:

  • in WebView content where mode is set to URL, the functions must be prefixed by tk e.g. tk.flash('Woo!')
  • when executing code via eval the functions must be prefixed by tk.
https://tasker.joaoapps.com/userguide/en/javascript.html

Taskerではそのほとんどのアクションをウェブビュー要素やJavascript(let)アクションから関数名を指定して直接呼び出すことができます。

例外:

  • ウェブビューのコンテンツがURLモードにセットされている場合、関数名は前にtkを付けて呼び出す必要があります。例:tk.flash(‘Woo!’)
  • 関数を評価した結果からコードを実行する場合にも前にtkを付ける必要があります。

alarmVol / btVoiceVol / callVol / dtmfVol / mediaVol / notificationVol / systemVol / ringerVol(アラーム音量、ブルートゥース音声の音量、通話音量、発信音量、メディア音量、通知音量、システム音量、呼び出し音量)

var ok = alarmVol( int level, bool display, bool sound )

Set the relevant system volume to level.

If display is true, the new level will be flashed up on-screen.

If sound is true, a tone will sound at the new level.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = alarmVol( int level, bool display, bool sound )

関連するシステム音量を level で指定します。

display が true に設定されている場合、変更された音量が画面にフラッシュ表示されます。

sound が true に設定されている場合、変更された音量で音が鳴ります。

audioRecord(録音)

var ok = audioRecord( str destPath, str source, str codec, str format )

  • destPath: where to put the recording. Note that a file extension is not necessary, it will correspond to the selected format.
  • source: def, mic, call, callout or callin
  • codec: amrn, amrw or aac
  • format: mp4, 3gpp, amrn or amrw

The JavaScript does not wait for the audio recording to complete.

See also: audioRecordStop().

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = audioRecord( str destPath, str source, str codec, str format )

  • destPath:録音データの保存場所です。ファイル名に拡張子は必要ありません。録音形式に応じます。
  • source:def(デフォルト)、mic(マイク)、call(通話)、callout(発信)または callin(着信)
  • codec:amrn(AMR-NB)、amrw(AMR-WB)、aac(Advanced Audio Coding)
  • format:mp4(エムピーフォー)、3gpp(スリージージーピー / Third Generation Pertnership Project)、amrn または amrw

Javascriptの実行は音声の録音中も中断されません。

次項 audioRecordStop() もご覧下さい。

audioRecordStop(録音停止)

var ok = audioRecordStop()

Stop recording previously initiated by audioRecord().

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = audioRecordStop()

audioRecord()で開始した録音を停止します。

browseURL(URLのブラウズ)

var ok = browseURL( str URL )

Open the default browser at the specifed URL.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = browseURL( str URL )

指定されたURLを標準ブラウザで開きます。

button(ボタン)

var ok = button( str name )

Simulate a press of the named button.

name must be one of back, call, camera, endcall, menu, volup, voldown or search.

This function requires a rooted device.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = button( str name )

名前付きのボタンの押下げをシミュレートします。

ボタンの名前は back、call、camera、endcall、menu、volup、vdown、search のいずれかです。

この関数を実行するには端末がルート化されている必要があります。

call(電話をかける)

var ok = call( str num, bool autoDial )

Make a phone call.

If autoDial is false, the phone app will be brought up with the number pre-inserted, if true the number will also be dialed.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = call( str num, bool autoDial )

電話をかけます。

autoDial が false の場合、指定した電話番号が入力された状態で電話アプリが起動し、true の場合は更に発信も行います。

callBlock(着信拒否)

var ok = callBlock( str numMatch, bool showInfo )

Block outgoing calls matching numMatch.

If showInfo is set, Tasker will flash a message when a call is blocked.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = callBlock( str numMatch, bool showInfo )

numMatch で指定した番号に一致する番号からの着信を拒否します。

showInfo が設定されている場合、Taskerは着信拒否をしたときにメッセージをフラッシュ表示します。

callDivert(着信転送)

var ok = callDivert( str fromMatch, str to, bool showInfo )

Divert outgoing calls matching fromMatch to the number to.

If showInfo is set, Tasker will flash a message when a call is diverted.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = callDivert( str fromMatch, str to, bool showInfo )

fromMatch に指定した番号に一致した番号からの着信を to に指定した番号に転送します。

showInfoが設定されている場合、Taskerは着信転送をしたときにメッセージをフラッシュ表示します。

callRevert(着信の再開)

var ok = callRevert( str numMatch )

Stop blocking or diverting outgoing calls previously specified with callBlock or callDivert.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = callRevert( str numMatch )

事前にcallBlock関数やcallDivert関数で設定した着信拒否や着信転送を解除します。

carMode(車載モード)

var ok = carMode( bool onFlag )

Turn on or off Android Car Mode.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = carMode( bool onFlag )

Androidの車載モードのオン・オフを切り替えます。

clearKey(暗号キーを消去する)

var ok = clearKey( str keyName )

Clear the passphrase for the specified keyName.

See Also: Encryption in the Userguide.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = clearKey( str keyName )

指定されたキー名のパスワードを消去します。

ユーザーガイドの暗号化の項もご覧下さい。

composeEmail(Eメールの作成)

var ok = composeEmail( str to, str subject, str message )

Show an email composition dialog with any specified fields pre-filled.

The JavaScript does not wait for the email to be sent before continuing.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = composeEmail( str to, str subject, str message )

指定された項目が入力された状態でメール作成ウィンドウを表示します。

Javascriptは作成されたメールの送信を待たずに実行が継続されます。

composeMMS(MMSの作成)

var ok = composeMMS( str to, str subject, str message, str attachmentPath )

Show an MMS composition dialog with any specified fields pre-filled.

The JavaScript does not wait for the MMS to be sent before continuing.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = composeMMS( str to, str subject, str message, str attachmentPath )

事前に指定された項目が入力された状態でMMSの作成ウィンドウを表示します。

Javascriptは作成されたMMSの送信を待たずに実行を継続します。

composeSMS(SMSの作成)

var ok = composeSMS( str to, str message )

Show an SMS composition dialog with any specified fields pre-filled.

The JavaScript does not wait for the SMS to be sent before continuing.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = composeSMS( str to, str message )

事前に指定された項目が入力された状態でSMSの作成ウィンドウを表示します。

Javascriptは作成されたSMSの送信を待たずに実行を継続します。

convert(変換)

var result = convert( str val, str conversionType )

Convert from one type of value to another.

conversionType must be one of the string constants: byteToKbyte, byteToMbyte, byteToGbyte, datetimeToSec, secToDatetime, secToDatetimeM, secToDatetimeL, htmlToText, celsToFahr, fahrToCels, inchToCent, metreToFeet, feetToMetre, kgToPound, poundToKg, kmToMile, mileToKm, urlDecode, urlEncode, binToDec, decToBin, hexToDec, decToHex, base64encode base64decode, toMd5, toSha1, toLowerCase, toUpperCase, toUpperCaseFirst. See also: action Variable Convert.

https://tasker.joaoapps.com/userguide/en/javascript.html

var result = convert( str val, str conversionType )

ある型の値を別の型に変換します。

変換可能な型は次の文字定数で表されるもののいずれかです。

byteToKbyte, byteToMbyte, byteToGbyte, datetimeToSec, secToDatetime, secToDatetimeM, secToDatetimeL, htmlToText, celsToFahr, fahrToCels, inchToCent, metreToFeet, feetToMetre, kgToPound, poundToKg, kmToMile, mileToKm, urlDecode, urlEncode, binToDec, decToBin, hexToDec, decToHex, base64encode base64decode, toMd5, toSha1, toLowerCase, toUpperCase, toUpperCaseFirst

変数の変換アクションの項もご覧下さい。

createDir(ディレクトリの作成)

var ok = createDir( str dirPath, bool createParent, bool useRoot )

Create the named dirPath. If createParent is specified and any parent directory does not exist, it will also be created.

If useRoot is specified, the operation will be performed as the root user (where available).

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = createDir( str dirPath, bool createParent, bool useRoot )

名前付きのディレクトリパスを作成します。createParent が指定され親ディレクトリがない場合は新規に作成されます。

useRoot が指定された場合、(可能な場合は)ルート権限で操作が行われます。

createScene(シーンの作成)

var ok = createScene( str sceneName )

Create the named scene without displaying it.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = createScene( str sceneName )

名前付きのシーンを表示せずに作成します。

cropImage(画像のトリミング)

var ok = cropImage( int fromLeftPercent, int fromRightPercent, int fromTopPercent, int fromBottomPercent )

Crop an image in Tasker’s image buffer previously loaded via loadImage.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = cropImage( int fromLeftPercent, int fromRightPercent, int fromTopPercent, int fromBottomPercent )

loadImage関数によって既にTaskerに取り込まれている画像のトリミングを行います。

decryptDir(ディレクトリの復号化)

var ok = decryptDir( str path, str key, bool removeKey )

As decryptFile(), but decrypts each file in the specified directory in turn.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = decryptDir( str path, str key, bool removeKey )

decryptFile()関数と同様に指定されたディレクトリ内の各ファイルを復号化します。

decryptFile(ファイルの復号化)

var ok = decryptFile( str path, str key, bool removeKey )

Decrypt the specified file using the encryption parameters specified in Menu / Prefs / Action.

If removeKey is not set, the entered passphrase will be reapplied automatically to the next encryption/decryption operation with the specified keyName.

See Also: Encryption in the Userguide, Decrypt File action.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = decryptFile( str path, str key, bool removeKey )

メニュー / Tasker基本設定 / アクションで指定された暗号化のパラメーターを使ってファイルを復号化します。

removeKey が指定されていない場合入力されたパスフレーズは、指定されたキーと共に次回の暗号化または復号化の際に自動的に再利用されます。

ユーザーガイドの暗号化の項とdecriptFileアクションの項もご覧下さい。

deleteDir(ディレクトリの削除)

var ok = deleteDir( str dirPath, bool recurse, bool useRoot )

Delete the named dirPath. recurse must be specified if the directory is not empty.

If useRoot is specified, the operation will be performed as the root user (where available).

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = deleteDir( str dirPath, bool recurse, bool useRoot )

dirPath に指定された名前のディレクトリを削除します。対照のディレクトリがから出ない場合、recurse パラメーターを true に指定する必要があります。

useRoot を指定した場合、可能であればルートユーザーとして操作を行います。

deleteFile(ファイルの削除)

var ok = deleteFile( str filePath, int shredTimes, bool useRoot )

Delete the named filePath.

shredTimes has range 0-10.

If useRoot is specified, the operation will be performed as the root user (where available).

See also: action Delete File

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = deleteFile( str filePath, int shredTimes, bool useRoot )

filePath に指定された名前のファイルを削除します。

shredTimes には 0-10 の範囲の数字を指定します。

useRoot が指定されている場合、可能であればルートユーザーとして操作を行います。

ファイルの削除アクションの項も併せてご覧下さい。

destroyScene(シーンの破棄)

var ok = destroyScene( str sceneName )

名前付きシーンが表示されている場合は非表示にした後破棄します。

displayAutoBright(画面の明るさを自動調節)

var ok = displayAutoBright( bool onFlag )

Whether the display brightness should automatically adjust to the ambient light or not.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = displayAutoBright( bool onFlag )

周囲の明るさに応じて画面の明るさを自動で調節するかどうかを指定します。

displayAutoRotate(画面の自動回転)

var ok = displayRotate( bool onFlag )

Whether the display orientation should change based on the physical orientation of the device.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = displayRotate( bool onFlag )

端末の向きに従って画面の向きを自動で変更するかどうかを指定します。

displayTimeout(消灯時間)

var ok = displayTimeout( int hours, int minutes, int seconds )

How long the period of no-activity should be before the display is turned off.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = displayTimeout( int hours, int minutes, int seconds )

どのくらいの時間操作がなかったら画面を消灯するかを指定します。

dpad(Dパッド)

var ok = dpad( str direction, int noRepeats )

Simulate a movement or press of the hardware dpad (or trackball).

direction must be one of up, down, left, right or press.

This function requires a rooted device.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = dpad( str direction, int noRepeats )

ハードウェアのDパッド(またはトラックボール)の動作をシミュレートします。

directionパラメーターに指定できる値は、up、down、left、right または press のいずれかです。

この関数が機能するためには端末がルート化されている必要があります。

enableProfile(プロファイルの有効化)

var ok = enableProfile( str name, boolean enable )

Enable or disable the named Tasker profile.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = enableProfile( str name, boolean enable )

Taskerのプロファイル名を指定して、有効/無効を切り替えます。

encryptDir(ディレクトリの暗号化)

var ok = encryptDir( str path, str keyName, bool rememberKey, bool shredOriginal )

As encryptFile(), but encrypts each file in the specified directory in turn.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = encryptDir( str path, str keyName, bool rememberKey, bool shredOriginal )

encryptFile()ではディレクトリ内のファイルを個別に暗号化したのに対し、これはディレクトリを一括で暗号化します。

elemBackColour(要素の背景色)

var ok = elemBackColour( str scene, str element, str startColour, str endColour )

Set the background colour of the specified scene element.

See also: action Element Back Colour.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = elemBackColour( str scene, str element, str startColour, str endColour )

指定されたシーン要素の背景色を設定します。

エレメントの背景色アクションの項もご覧下さい。

elemBorder(要素の境界線の色)

var ok = elemBorder( str scene, str element, int width, str colour )

Set the border colour and width of the specified scene element.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = elemBorder( str scene, str element, int width, str colour )

指定したシーン要素の境界線の色を指定します。

elemPosition(要素の位置)

var ok = elemPosition( str scene, str element, str orientation, int x, int y, int animMS )

Move an element within it’s scene.

orientation must be one of port or land. animMS indicates the duration of the corresponding animation in MS. A zero-value indicates no animation.

See also: action Element Position.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = elemPosition( str scene, str element, str orientation, int x, int y, int animMS )

シーン内での要素の位置を変更します。

orientationパラメーターに指定する値は post または land のいずれかでなければなりません。animMSパラメーターには移動に伴うアニメーション効果の長さをミリ秒で指定します。0を指定するとアニメーションは行われません。

要素の座標アクションの項もご覧下さい。

elemText(要素の文字)

var ok = elemText( str scene, str element, str position, str text )

Set the text of the specified scene element.

pos must be one of repl (replace existing text completely), start (insert before existing text) or end (append after existing text).

See also: action Element Text.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = elemText( str scene, str element, str position, str text )

指定されたシーンの要素に表示する文字をしていします。

posパラメーターの値は repl(現在の文字を完全に置き換える)、start(現在の文字の前に挿入する)、end(現在の文字の後ろに挿入する)のいずれかでなければなりません。

要素の文字アクションの項もご覧下さい。

elemTextColour(要素の文字色)

var ok = elemTextColour( str scene, str element, str colour )

Set the text colour of the specified scene element.

See also: action Element Text Colour.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = elemTextColour( str scene, str element, str colour )

指定されたシーン要素の文字色を指定します。

要素の文字色アクションの項もご覧下さい。

elemTextSize(要素の文字サイズ)

var ok = elemTextSize( str scene, str element, int size )

Set the text size of the specified scene element.

See also: action Element Text Size.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = elemTextSize( str scene, str element, int size )

指定したシーン要素の文字のサイズを指定します。

シーンの文字サイズアクションの項もご覧下さい。

elemVisibility(要素の可視性)

var ok = elemVisibility( str scene, str element, boolean visible, int animationTimeMS )

Make the specified scene element visible or invisible.

See also: action Element Visibility.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = elemVisibility( str scene, str element, boolean visible, int animationTimeMS )

指定したシーン要素を表示するかどうかを指定します。

要素の可視性アクションの項もご覧下さい。

endCall(通話終了)

var ok = endCall()

Terminate the current call (if there is one).

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = endCall()

現在の通話(通話中であれば)を終了します。

encryptFile(ファイルの暗号化)

var ok = encryptFile( str path, str keyName, bool rememberKey, bool shredOriginal )

Encrypt the specified file using the encryption parameters specified in Menu / Prefs / Action.

If rememberKey is set, the entered passphrase will be reapplied automatically to the next encryption/decryption operation with the specified keyName.

If shredOriginal is specified, the original file will be overwritten several times with random bits if encryption is successful.

See Also: Encryption in the Userguide, Encrypt File action.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = encryptFile( str path, str keyName, bool rememberKey, bool shredOriginal )

メニューのTasker基本設定/アクション で設定されている暗号化パラメーターで指定されたファイルを暗号化します。

remenberKey(キーを記憶)が設定されている場合、指定されたキー名で行われる次回の暗号化/復号化に指定されたパスフレーズが自動的に適用されます。

shredOriginal(オリジナルの破棄)が指定されている場合、暗号化が正常に行われた場合には元のファイルはランダムなビット列によって数回上書きされます。

ユーザーガイドの暗号化の項と、ファイルの暗号化アクションの項もご覧下さい。

enterKey(キーの入力)

var ok = enterKey( str title, str keyName, bool showOverKeyguard, bool confirm, str background, str layout, int timeoutSecs )

Show a dialog to enter the passphrase for the specified keyName. The JavaScript waits until the dialog has been dismissed or the timeout reached.

  • confirm: if set, the passphrase must be entered twice to ensure it is correct.
  • background: [optional] a file path or file URI to a background image.
  • layout: the name of a user-created scene to use in place of the built-in scene.

See Also: Encryption in the Userguide

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = enterKey( str title, str keyName, bool showOverKeyguard, bool confirm, str background, str layout, int timeoutSecs )

指定されたキー名のためのパスフレーズの入力を求めるダイアログを表示します。Javascriptの実行はダイアログが閉じられるか時間切れになるまで停止します。

  • confirm パラメーター:設定されている場合には、入力されたパスフレーズに間違いが無いことを確認するため、二回のパスフレーズの入力を求められます。
  • background(背景)パラメーター:(これはオプションです)背景画像用ファイルへのパスまたはURIを指定します。
  • layout(レイアウト)パラメーター:組み込みシーンの代わりに使用するユーザーが作成したシーンの名前を指定します。

ユーザーガイドの暗号化の項もご覧下さい。

filterImage(画像のフィルタリング)

bool ok = filterImage( str mode, int value )

Filter an image previously loaded into Tasker’s image buffer via loadImage()

Possible values of mode are:

  • bw: convert to black & white, using value as a threshold
  • eblue: enhance blue values by value
  • egreen: enhance green values by value
  • ered: enhance red values by value
  • grey: convert to greyscale, value is unused
  • alpha: set pixel alpha (opposite of transparency) to value

value should be 1-254.

https://tasker.joaoapps.com/userguide/en/javascript.html

bool ok = filterImage( str mode, int value )

loadImage()関数を使ってTaskerのイメージバッファから画像を読み込む前にフィルターをかけます。

mode パラメーターには以下のいずれかの値を指定します。

  • bw:白黒画像に変換します。value パラメーターは白と黒を振り分けるための閾値を指定します。
  • eblue:青みをどのくらい強めるかを value パラメーターの値で指定します。
  • egreen:緑みをどのくらい強めるかを value パラメーターの値で指定します。
  • ered:赤みをどのくらい強めるかを value パラメーターの値で指定します。
  • gray:画像をグレースケールに変換します。value パラメーターは使用しません。
  • alpha:画素の不透明度(透明度の逆)を value パラメーターの値で設定します。

値は1~254の範囲で指定します。

flipImage(画像の反転)

bool ok = flipImage( bool horizontal )

Flip an image previously loaded into Tasker’s image buffer via loadImage()

If horizontal is false, the image is flipped vertically.

https://tasker.joaoapps.com/userguide/en/javascript.html

bool ok = flipImage( bool horizontal )

loadImage()関数を使って予め読み込んでおいたTaskerのイメージバッファの画像を左右s反転させます。

horizontal パラメーターが指定された場合上下を反転します。

exit(終了)

exit()

Stop execution of the JavaScript.

https://tasker.joaoapps.com/userguide/en/javascript.html

exit()

現在実行中のJavascriptを停止します。

flash(フラッシュ)

flash( str message )

Flash a short-duration Android ‘Toast’ message.

https://tasker.joaoapps.com/userguide/en/javascript.html

flash( str message )

Androidのトーストメッセージを短時間表示します。

flashLong(長めのフラッシュ)

flashLong( str message )

Flash a long-duration Android ‘Toast’ message.

https://tasker.joaoapps.com/userguide/en/javascript.html

flashLong( str message )

Androidのトーストメッセージを長めに表示します。

getLocation(位置情報の取得)

var ok = getLocation( str source, bool keepTracking, int timeoutSecs )

Try to get a fix of the current device location.

source must be one of gps, net or any.

If keepTracking is set, the specified source(s) will be left tracking with the purpose of providing a much quicker fix next time the function is called.

Fix coordinates are stored in the global Tasker variables %LOC (GPS) and/or %LOCN (Net). The value can be retrieved with the global function. Several other parameters of the fix are also available, see Variables.

Example


	var lastFix = global( 'LOC' );
	if ( 
		getLocation( 'gps' ) &&
		( global( 'LOC' ) != lastFix ) 
	) {
		flash( "New fix: " + global( 'LOC' ) );
	}

See also: action Get Location, function stopLocation.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = getLocation( str source, bool keepTracking, int timeoutSecs )

現在の端末の位置座標を計算します。

source パラメーターの値は、gps、net または any のいずれかです。

keepTrackingパラメーターが有効な場合は、次回この関数が使用される時に素早く対応できるように指定された source による追跡を続行します。

計算された座標情報はTaskerのグローバル変数 %LOC(GPS) や %LOCN(Net)に格納されます。格納された値はグローバル関数から参照可能で、座標計算に関するその他のパラメーターも取得可能です。変数の項もご覧下さい。


	var lastFix = global( 'LOC' );
	if ( 
		getLocation( 'gps' ) &&
		( global( 'LOC' ) != lastFix ) 
	) {
		flash( "New fix: " + global( 'LOC' ) );
	}

現在位置の取得アクションとstopLocation関数の項もご覧下さい。

getVoice(音声認識)

str result = getVoice( str prompt, str languageModel, int timeout )

Get voice input and convert to text.

result is ‘undefined’ if the voice acquisition failed, otherwise it’s an array of possible matching texts.

prompt is a label for the dialog that is shown during voice acquisition.

languageMode gives the speech recognition engine a clue as to the context of the speech. It must be one of web for ‘web search’ or free for ‘free-form’.

https://tasker.joaoapps.com/userguide/en/javascript.html

str result = getVoice( str prompt, str languageModel, int timeout )

音声認識による入力を行いテキストに変換します。

音声の取得に失敗した場合には戻り値は undefined となり、成功した場合は一致する可能性のある認識結果を配列として返します。

prompt パラメーターは音声認識中に表示されるダイアログのタイトルを指定します。

languageMode パラメーターを指定することで音声認識エンジンに音声の文脈に関するヒントを与えることができます。指定できる値はネット検索を意味する web または自由形式を意味する free-form のいずれかです。

goHome(ホーム画面に戻る)

goHome( int screenNum )

Go to the Android home screen. screenNum is not supported by all home screens.

https://tasker.joaoapps.com/userguide/en/javascript.html

goHome( int screenNum )

Androidのホーム画面を表示します。screenNum パラメーターは全てのホーム画面で指定可能な訳ではありません。

haptics(触覚)

var ok = haptics( bool onFlag )

Enable/disable system setting Haptic Feedback.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = haptics( bool onFlag )

システム設定で触覚フィードバックの有効/無効を切り替えます。

hideScene(シーンを非表示)

var ok = hideScene( str sceneName )

Hide the named scene if it’s visible.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = hideScene( str sceneName )

シーンが表示されている場合は非表示にします。

global(グローバル変数)

var value = global( str varName )

Retrieve the value of a Tasker global variable. Prefixing the name with % is optional.

Example:


flash( global( '%DogName' ) );
https://tasker.joaoapps.com/userguide/en/javascript.html

var value = global( str varName )

Taskerのグローバル変数の値を取得します。変数名の前に付く % はオプションです。

例:


flash( global( '%DogName' ) );

listFiles(ファイルの列挙)

str files = listFiles( str dirPath, bool hiddenToo )

List all files in the specified dirPath.

files is a newline-separated list of subfiles.

If no files or found or an error occurs, the returned value will be undef. If hiddenToo is specified, files starting with period are included, otherwise they are not.

Example:

	var files = listFiles( '/sdcard' );
var arr = files.split( '\n' );
flash( 'Found ' + arr.length + ' files' );
https://tasker.joaoapps.com/userguide/en/javascript.html

str files = listFiles( str dirPath, bool hiddenToo )

dirPath パラメーターで指定したディレクトリのファイルを列挙します。

戻り値は改行区切りのファイルのリストです。

ファイルが見つからなかったりエラーが発生した場合は、undef (未定義)が返ります。hiddenToo パラメーターが指定されている場合、ピリオドで始まるファイル名を持つファイル(隠しファイル)も含みます。

例:

	var files = listFiles( '/sdcard' );
var arr = files.split( '\n' );
flash( 'Found ' + arr.length + ' files' );

loadApp(アプリの読み込み)

var ok = loadApp( str name, str data, bool excludeFromRecents )

Start up the named app.

Name can be a package name or app label, it’s tested first against known package names. Note: app label could be localized to another language if the script is used in an exported app.

Data is in URI format and app-specific.

When excludeFromRecents is true, the app will not appear in the home screen ‘recent applications’ list.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = loadApp( str name, str data, bool excludeFromRecents )

名前付きアプリを開始します。

名前の指定は、パッケージ名かアプリのラベルで行い、まずパッケージ名での検索を行います。
注記:アプリのラベルは他の言語にローカライズされる可能性があり、スクリプトの実行はローカライズされた環境下で行われる点に注意してください。

data パラメーターはURI形式およびアプリ指定の形式で指定します。

excludeFromRecents パラメーターが true の場合、開始したアプリはホーム画面の「現在のアプリ」リストに含まれません。

loadImage(画像の読み込み)

var ok = loadImage( str uri )

Load an image into Tasker’s internal image buffer.

The following uri formats are currently supported:

  • file:// followed by a local file path

See also Load Image action.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = loadImage( str uri )

Taskerの内部バッファに画像を読み込みます。

以下のURI形式が現在指定可能です。

  • file://[ローカルファイルのパス]

Load Imageアクションの項もご覧下さい。

lock(ロック画面)

var ok = lock( str title, str code, bool allowCancel, bool rememberCode, bool fullScreen, str background, str layout )

Show a lock screen, preventing user interaction with the covered part of the screen. The JavaScript waits until the code has been entered or the lock cancelled (see below).

  • code: the numeric code which must be entered for unlock
  • allowCancel: show a button to remove the lockscreen, which causes a return to the Android home screen
  • rememberCode: the code will be remembered and automatically entered when the lock screen is show in future, until the display next turns off
  • background: [optional] a file path or file URI to a background image.
  • layout: the name of a user-created scene to use in place of the built-in lock scene
https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = lock( str title, str code, bool allowCancel, bool rememberCode, bool fullScreen, str background, str layout )

ロック画面を表示します。画面の覆われた部分に対するユーザーの操作を受け付けないようになります。Javascriptの実行はコードが入力されるかロックが解除されるまで中断されます。(以下をご覧下さい。)

  • code パラメーター:ロックの解除に必要なコードを数字で指定します。
  • allowCancel パラメーター:ロック画面のキャンセルボタンを表示します。ボタンが押されるとAndroidのホーム画面に戻ります。
  • rememberCode パラメーター:画面が消灯状態になるまではロック画面表示の際は解除コードが自動で入力されます。
  • background パラメーター(オプション):背景画像に使用する画像ファイルへのパスもしくはURIを指定します。
  • layout パラメーター:組み込みのロック画面の代わりに使うユーザーが作ったシーンの名前を指定します。

local(ローカル変数)

var value = local( str varName )

Retrieve the value of a Tasker scene-local variable. The name should not be prefixed with %.

This function is only for use by JavaScript embedded in HTML and accessed via a WebView scene element.

https://tasker.joaoapps.com/userguide/en/javascript.html

var value = local( str varName )

Taskerのシーンでローカル変数の値を取得します。変数名は頭に % を付けずに指定します。

この関数はHTML内に記述されたJavascriptでのみ機能します。値の取得はシーンのウェブビューから行います。

mediaControl(メディアの制御)

var ok = mediaControl( str action )

Control media via simulation of hardware buttons.

Possible actions are next, pause, prev, toggle, stop or play.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = mediaControl( str action )

ハードウェアボタンをシミュレートしてメディアの制御を行います。

実行可能なアクションは next(進む)、pause(一時停止)、prev(戻る)、toggle(切り替え)、stop(停止)および play(再生)です。

micMute(マイクの消音)

var ok = micMute( bool shouldMute )

Mute or unmute the device’s microphone (if present),

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = micMute( bool shouldMute )

端末のマイク(付いていれば)のミュートまたはミュート解除を行います。

mobileData(モバイルデータ通信)

var ok = mobileData( bool set )

Enable or disable the system Mobile Data setting.

See also: action Mobile Data

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = mobileData( bool set )

システムのモバイルデータの設定の有効/無効を切り替えます。

モバイルデータアクションの項もご覧下さい。

musicBack(早戻し)

var ok = musicBack( int seconds )

Skip back by seconds during playback of a music file previously started by musicPlay.

See also: musicSkip, musicStop

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = musicBack( int seconds )

musicPlay関数によって再生中の音楽を second パラメーターに指定した秒数分早戻しを行います。

musicSkip musicStop の項もご覧下さい。

musicPlay(音楽の再生)

var ok = musicPlay( str path, int offsetSecs, bool loop, str stream )

Play a music file via Tasker’s internal music player.

stream to which audio stream the music should be played

This function does not not wait for completion.

The last 3 arguments may be ommitted, in which case they default to 0, false and media respectively.

See also: musicStop, musicBack, musicSkip

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = musicPlay( str path, int offsetSecs, bool loop, str stream )

Taskerの内部プレーヤーで音楽ファイルを再生します。

stream パラメーターには音楽再生に使用するオーディオストリームを指定します。

この関数は実行完了を待たずにスクリプトの実行を続けます。

最後の三つの引数は省略可能です。その場合、各々 0、false、media に設定されます。

musicStopmusicBackmusicSkip の各項もご覧下さい。

var ok = musicPlay( str path, int offsetSecs, bool loop, str stream )

Play a music file via Tasker’s internal music player.

stream to which audio stream the music should be played

This function does not not wait for completion.

The last 3 arguments may be ommitted, in which case they default to 0, false and media respectively.

See also: musicStop, musicBack, musicSkip

musicSkip(早送り)

var ok = musicSkip( int seconds )

Skip forwards by seconds during playback of a music file previously started by musicPlay.

See also: musicBack, musicStop

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = musicSkip( int seconds )

musicPlay 関数によって再生中の音楽を seconds パラメーターに指定した秒数分早送りします。

musicBack、musicStop の各項もご覧下さい。

musicStop(再生の停止)

var ok = musicStop()

Stop playback of a music file previously started by musicPlay.

See also: musicBack, musicSkip

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = musicStop()

musicPlay 関数によって再生中の音楽を停止します。

musicBackmusicSkip の各項もご覧下さい。

nightMode(夜間モード)

var ok = nightMode( bool onFlag )

Turn on or off Android Night Mode.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = nightMode( bool onFlag )

Androidの夜間モードの有効/無効を切り替えます。

var ok = popup( str title, str text, bool showOverKeyguard, str background, str layout, int timeoutSecs )

Show a popup dialog. The JavaScript waits until the popup has been dismissed or the timeout reached.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = popup( str title, str text, bool showOverKeyguard, str background, str layout, int timeoutSecs )

ポップアップダイアログを表示します。ダイアログが閉じられるか時間切れになるまでJavascriptは実行を停止します。

  • background(背景)パラメーター:(オプション)背景イメージ用画像へのファイルパスまたはURIを指定します。
  • layout(レイアウト)パラメーター:組み込みのポップアップ用シーンに代わって使用するユーザー作成のシーンの名前を指定します。

performTask(Taskの実行)

var ok = performTask( str taskName, int priority, str parameterOne, str parameterTwo, str returnVariable, bool stop, bool variablePassthrough, str variablePassthroughList, bool resetReturnVariable )

Run the Tasker task taskName.

Note that the JavaScript does not wait for the task to complete.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = performTask( str taskName, int priority, str parameterOne, str parameterTwo, str returnVariable, bool stop, bool variablePassthrough, str variablePassthroughList, bool resetReturnVariable )

taskName パラメーターに指定したTaskerのタスクを実行します。

タスクの実行完了を待たずにJavascriptの実行が継続される点に注意してください。

profileActive(プロファイルのアクティブ状態)

bool active = profileActive( str profileName )

Whether the named Tasker profile is currently active. Returns false if the profile name is unknown.

https://tasker.joaoapps.com/userguide/en/javascript.html

bool active = profileActive( str profileName )

Taskerの名前付きプロファイルがアクティブかどうかを返します。プロファイルの名前が不正な場合には false が返ります。

pulse(バイブレーション)

bool ok = pulse( bool onFlag )

Enable or disable the Android Notification Pulse system setting.

https://tasker.joaoapps.com/userguide/en/javascript.html

bool ok = pulse( bool onFlag )

Androidのバイブ通知設定の有効/無効を切り替えます。

readFile(ファイルの読み込み)

var contents = readFile( str path )

Read the contents of a text file.

https://tasker.joaoapps.com/userguide/en/javascript.html

var contents = readFile( str path )

テキストファイルの内容を読み込みます。

reboot(再起動)

var ok = reboot( str type )

Reboot the device.

type is one of normal, recovery or bootloader. It can be ommitted and defaults to normal.

Requires a rooted device.

See also: function shutdown

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = reboot( str type )

端末を再起動します。

type パラメーターに指定できる値は normal(通常)、recovery(リカバリーモード)、bootloader(ブートローダー)のいずれかです。

ルート化された端末で使用可能です。

shutdown 関数の項もご覧下さい。

resizeImage(画像のリサイズ)

var ok = resizeImage( int width, int height )

Scale the current image in Tasker’s image buffer to the specified dimensions.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = resizeImage( int width, int height )

Taskerのイメージバッファ内の画像を指定されたサイズに変更します。

rotateImage(画像の回転)

var ok = rotateImage( str dir, int degrees )

Rotate the current image in Tasker’s image buffer.

dir must be one of left or right. degrees must be one of 45, 90, 135 or 180.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = rotateImage( str dir, int degrees )

Taskerのイメージバッファ内の画像を回転します。

dir パラメーターに指定する値は left または right のいずれかです。degrees パラメーターに指定する値は 45、90、135、180 のいずれかでなければなりません。

saveImage(画像の保存)

var ok = saveImage( str path, int qualityPercent, bool deleteFromMemoryAfter )

Save the current image in Tasker’s image buffer to the specified file path.

Save Image action.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = saveImage( str path, int qualityPercent, bool deleteFromMemoryAfter )

Taskerのイメージバッファ内の画像を指定したファイルに保存します。

画像の保存アクションの項もご覧下さい。

var ok = saveImage( str path, int qualityPercent, bool deleteFromMemoryAfter )

Save the current image in Tasker’s image buffer to the specified file path.

Save Image action.

say(読み上げ)

var ok = say( str text, str engine, str voice, str stream, int pitch, int speed )

Cause the device to say text out loud.

  • engine: the speech engine e.g. com.svox.classic Defaults to the system default (specify undefined for that)
  • voice: the voice to use (must be supported by engine). Defaults to the current system language (specify undefined for that)
  • stream: to which audio stream the speech should be made
  • pitch: 1-10
  • speed: 1-10

The script waits for the speech to be finished.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = say( str text, str engine, str voice, str stream, int pitch, int speed )

端末に text パラメーターに指定した内容を読み上げさせます。

  • engin (読み上げエンジン)パラメーター:com.svox.classic などの読み上げエンジンを指定します。デフォルトでシステムの標準のエンジンを使用する場合は undefined を指定します。
  • voice(声色)パラメーター:読み上げる際の声色を指定します(読み上げエンジンでサポートされている必要があります)。デフォルトでシステムの言語設定を使用する場合は undefined を指定します。
  • stream(オーディオストリーム)パラメーター:音声を流すオーディオストリームを指定します。
  • pitch(ピッチ)パラメーター:1~10の範囲で指定します。
  • speed(スピード)パラメーター:1~10の範囲で指定します。

スクリプトの実行は読み上げの終了を待って再開されます。

sendIntent(インテントを送る)

var ok = sendIntent( str action, str targetComp, str package, str class, str category, str data, str mimeType, str[] extras );

Send an intent. Intents are Android’s high-level application interaction system.

Any parameter may be specified as undefined.

  • targetComp: the type of application component to target, one of receiver, activity or service. Defaults to receiver.
  • package: the application package to limt the intent to
  • class: the application class to limit the intent to
  • category: one of none, alt, browsable, cardock, deskdock, home, info, launcher, preference, selectedalt, tab or test, defaults to none
  • extras: extra data to pass, in the format key:value. May be undefined. Maximum length 2.

See also: action Send Intent.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = sendIntent( str action, str targetComp, str package, str class, str category, str data, str mimeType, str[] extras )

インテントを送信します。インテントとはAndroidの高度なアプリケーションインタラクションシステムの事です。

どのパラメーターも undefined (未定義)として指定できます。

  • targetComp(ターゲットコンポーネント)パラメーター:ターゲットとするアプリケーションコンポーネントのタイプを指定します。指定できる値は receiver、activity または service のいずれかです。receiver がデフォルトの値です。
  • package(パッケージ)パラメーター:指定したアプリケーションパッケージにインテントの発信を限定します。
  • class(クラス)パラメーター:指定したアプリケーションクラスにインテントの発信を制限します。
  • category(カテゴリー)パラメーター:指定できる値は none、alt、browsable、cardock、deskdock、home、info、launcher、preference、selectedalt、tab または test のいずれかで、デフォルト値は none です。
  • extras(追加)パラメーター:インテントとして渡す追加のデータを key(キー):value(値)という形式で指定します。undefined(未定義)とすることもできます。最大長は2です。

インテントの発信アクションの項もご覧下さい。

sendSMS(SMSを送る)

var ok = sendSMS( str number, str text, boolean storeInMessagingApp );

Send an SMS.

See also: action Send SMS

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = sendSMS( str number, str text, boolean storeInMessagingApp );

SMSを発信します。

SMSの発信アクションの項もご覧下さい。

setAirplaneMode(機内モードの設定)

var ok = setAirplaneMode( bool setOn )

Enable or disable Airplane Mode.

Get the current value with:

var enabled = global( 'AIR' );

See also: function setAirplaneRadios

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = setAirplaneMode( bool setOn )

機内モードの有効/無効を切り替えます。

現在の値を取得するには次のようにします。

var enabled = global( 'AIR' );

setAirplaneRadios 関数の項もご覧下さい。

setAirplaneRadios(機内通信の設定)

var ok = setAirplaneRadios( str disableRadios )

Specify the radios which will be disabled when the device enters Airplane Mode.

disableRadios is a comma-separated list with radio names from the following set: cell, nfc, wifi, wimax, bt.

Get the current value with:

var radios = global( 'AIRR' );

See also: function setAirplaneMode

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = setAirplaneRadios( str disableRadios )

端末が機内モードになっているときに無効にする通信を指定します。

disableRadios パラメーターには、cell、nfc、wifi、wimax、bt の中からコンマ区切りのリストで指定します。

現在の値を取得するには次のようにします。

var radios = global( 'AIRR' );

setAirplaneMode 関数の項もご覧下さい。

setAlarm(アラームの設定)

var ok = setAlarm( int hour, int min, str message, bool confirmFlag )

Create an alarm in the default alarm clock app.

confirmFlag specifies whether the app should confirm that the alarm has been set.

message is optional.

Requires Android version 2.3+.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = setAlarm( int hour, int min, str message, bool confirmFlag )

標準の時計アプリにアラームをセットします。

confirmFlag パラメーターには、アプリが新規アラームの設定を確認するかどうかを指定します。

message パラメーターを指定するかどうかは任意です。

Androidのバージョン2.3以上で使用可能です。

setAutoSync(自動同期の設定)

var ok = setAutoSync( bool setOn )

Enable or disable the global auto-sync setting.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = setAutoSync( bool setOn )

グローバルな自動同期の有効/無効を切り替えます。

scanCard(メモリーカードの読み取り)

var ok = scanCard( str path )

Force the system to scan the external storage card for new/deleted media.

If path is defined, only that will be scanned.

See also: action Scan Card

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = scanCard( str path )

システムに新しい(または消去済みの)外部メモリーカードのスキャンを強制します。

path パラメーターが指定されている場合、スキャン対象を指定されたパスにのみ行います。

メモリーカードの読み取りアクションの項もご覧下さい。

setBT(ブルートゥースの設定)

var ok = setBT( bool setOn )

Enable or disable the Bluetooth radio (if present).

Test BT state with:

if ( global( 'BLUE' ) == "on" ) { doSomething(); }

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = setBT( bool setOn )

ブルートゥース(機能がある場合)の有効/無効を設定します。

ブルートゥースの状態を知るには次のようにします。

if ( global( 'BLUE' ) == "on" ) { doSomething(); }

setBTID(ブルートゥースIDの設定)

var ok = setBTID( str toSet )

Set the bluetooth adapter ID (the name as seen by other devices).

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = setBTID( str toSet )

ブルートゥース接続のID(接続先の端末に表示される名前)を設定します。

setGlobal(グローバル変数の設定)

setGlobal( str varName, str newValue )

Set the value of a Tasker global user variable. Prefixing varName with % is optional.

Arrays are not supported due to limitations of the Android JS interface.

https://tasker.joaoapps.com/userguide/en/javascript.html

setGlobal( str varName, str newValue )

Taskerのユーザー定義グローバル変数の値を設定します。変数名の頭に % を付けるかどうかは任意です。

AndroidのJavascriptインターフェースの制約により配列への値の設定は行えません。

setKey(暗号キーの設定)

var ok = setKey( str keyName, str passphrase )

Set the passphrase for the specified keyName.

See Also: Encryption in the Userguide.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = setKey( str keyName, str passphrase )

指定されたキー名に対応するパスフレーズを設定します。

ユーザーガイドの暗号化の項もご覧下さい。

setLocal(ローカル変数の設定)

setLocal( str varName, str newValue )

Set the value of a Tasker scene-local user variable. Variable names should not be prefixed with %.

This function is only for use by JavaScript embedded in HTML and accessed via a WebView scene element.

https://tasker.joaoapps.com/userguide/en/javascript.html

setLocal( str varName, str newValue )

Taskerのユーザー定義ろーかる変数の値を設定します。変数名の頭に % を付ける必要はありません。

この関数はウェブビューシーンエレメントに表示されたHTMLに埋め込まれたJavascriptでのみ使用可能です。

setClip(クリップボードの設定)

var ok = setClip( str text, bool appendFlag )

Set the global system clipboard.

Test the value with:

var clip = global( 'CLIP' );

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = setClip( str text, bool appendFlag )

グローバルなシステムクリップボードの内容を設定します。

現在のクリップボードの内容を取得するには次のようにします。

var clip = global( 'CLIP' );

settings(設定)

var ok = settings( str screenName )

Show an Android System Settings screen.

screenName must be one of all, accessibility, addacount, airplanemode, apn, app, batteryinfo, appmanage bluetooth, date, deviceinfo, dictionary, display, inputmethod, internalstorage, locale, location, memorycard, networkoperator, powerusage, privacy, quicklaunch, security, mobiledata, search, sound, sync, wifi, wifiip or wireless.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = settings( str screenName )

Androidのシステム設定画面を表示します。

screenName パラメーターに指定できる値は次のいずれかです。all、accessibility、addacount、airplanemode、apn、app、batteryinfo、appmanage、bluetooth、data、deviceinfo、dictionary、display、inputmethod、internalstorage、locale、memorycard、networkoperator、powerusage、privacy、quicklaunch、security、mobiledata、serch、sound、sync、wifi、wifiip、wireless

setWallpaper(壁紙の設定)

var ok = setWallpaper( str path )

Set the system home screen wallpaper.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = setWallpaper( str path )

システムのホーム画面の背景画像を設定します。

setWifi(WiFiの設定)

var ok = setWifi( bool setOn )

Enable or disable the Wifi radio (if present).

Test wifi state with:

if ( global( 'WIFI' ) == "on" ) { doSomething(); }

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = setWifi( bool setOn )

WiFi(機能があれば)の有効/無効を切り替えます。

現在のWiFiの設定を調べるには次のようにします。

if ( global( 'WIFI' ) == "on" ) { doSomething(); }

shell(シェルコマンド)

var output = shell( str command, bool asRoot, int timoutSecs )

Run the shell command command.

asRoot will only have effect if the device is rooted.

output is ‘undefined’ if the shell command failed. It’s maximum size is restricted to around 750K.

https://tasker.joaoapps.com/userguide/en/javascript.html

var output = shell( str command, bool asRoot, int timoutSecs )

command パラメーターに指定したシェルコマンドを実行します。

asRoot パラメーターはルート化済み端末でのみ有効です。

戻り値 output にはコマンドの実行が失敗すると undefined が格納されます。戻り値の最大サイズはおおむね750Kバイトまでに制限されています。

showScene(シーンの表示)

var ok = showScene( str name, str displayAs, int hoffset, int voffset, bool showExitIcon, bool waitForExit )

Show the named scene, creating it first if necessary.

  • displayAs: options: Overlay, OverBlocking, OverBlockFullDisplay, Dialog, DialogBlur, DialogDim, ActivityFullWindow, ActivityFullDisplay, ActivityFullDisplayNoTitle
  • hoffset, voffset: percentage vertical and horizontal offset for the scene -100% to 100% (not relevant for full screen/window display types)
  • showExitIcon: display a small icon in the bottom right which destroys the scene when pressed
  • waitForExit: whether to wait for the scene to exit before continuing the script
https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = showScene( str name, str displayAs, int hoffset, int voffset, bool showExitIcon, bool waitForExit )

名前付きシーンを表示します。必要であれば事前に表示するシーンを作成しておきます。

  • displayAs(表示方法)パラメーター:(オプション)Overlay(オーバーレイ)、OverBlockFullDisplay(オーバーレイ、遮断、ウィンドウ全体)、Dialog(ダイアログ)、DialogBlur(ダイアログ、背景もっと暗く)、DialogDim(背景、暗く)、ActivityFullDisplay(アクティビティ)、ActivityFullDisplayNoTitle(アクティビティ、タイトルバーなし)
  • hoffset(水平オフセット)、voffset(垂直オフセット):シーンの表示位置の水平・垂直方向のオフセット値を-100%から100%の間で指定します。(フルスクリーン表示タイプのシーンには効果がありません。)
  • showExitIcon(終了アイコンの表示):タップするとシーンを破棄する小さな終了アイコンをシーンの右下に表示します。
  • waitForExit(終了まで待つ):スクリプトの処理を継続する前にシーンが閉じられるのを待つかどうかを指定します。

shutdown(シャットダウン)

var ok = shutdown()

Shutdown the device.

Requires a rooted device.

See also: reboot

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = shutdown()

端末をシャットダウンします。

ルート化された端末でのみ有効です。

再起動の項もご覧下さい。

silentMode(サイレントモード)

var ok = silentMode( str mode )

Set the system silent (‘ringer’) mode.

mode must be one of off, vibrate or on

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = silentMode( str mode )

システムの無音(着信)モードを設定します。

mode パラメーターに指定する値は off、vibrate、on のいずれかです。

sl4a(SL4Aスクリプト)

var ok = sl4a( str scriptName, boolean inTerminal )

Run a previously created SL4A script.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = sl4a( str scriptName, boolean inTerminal )

事前に作成しておいたSL4Aスクリプトを実行します。

soundEffects(サウンドエフェクト)

var ok = soundEffects( bool setTo )

Setting the system Sound Effects setting (sound from clicking on buttons etc.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = soundEffects( bool setTo )

システムのサウンドエフェクト(タップ音など)の設定を行います。

speakerphone(スピーカーフォン)

var ok = speakerPhone( bool setFlag )

Enable or disable the speakerphone function.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = speakerPhone( bool setFlag )

スピーカーフォンの機能の有効/無効を切り替えます。

statusBar(ステータスバー)

var ok = statusBar( bool expanded )

Expand or contract the system status bar.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = statusBar( bool expanded )

システムのステータスバーを展開または格納するかを指定します。

stayOn(充電時の端末の電源)

var ok = stayOn( str mode )

Specify whether the device should remain on when power is connected.

Possible modes are never, ac, usb, any.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = stayOn( str mode )

端末が充電されている時に端末の電源をオンのままにするかどうかを指定します。

mode パラメーターに指定できる値は、never(しない)、ac(コンセントに接続時のみ)、usb(USB接続時のみ、any(常に)のいずれかです。

stopLocation

var ok = stopLocation()

Stop tracking a location provider. This is only relevant when a getLocation function has been previously called with the keepTracking parameter set.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = stopLocation()

位置情報プロバイダーからの位置情報の取得を停止します。この関数は事前にgetLocation(位置情報の取得)関数で、keepTracking(位置情報の追跡を継続)パラメーターが設定されている場合のみ有効です。

systemLock(システムのロック)

var ok = systemLock()

Turn off the display and activate the keyguard.

Requires Tasker’s Device Administrator to be enabled in Android settings.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = systemLock()

端末をオフにしてロックをかけます。

Androidの設定でTaskerの端末の管理権限を設定しておく必要があります。

taskRunning(実行中のタスク)

bool running = taskRunning( str taskName )

Whether the named Tasker task is currently running. Returns false if the task name is unknown.

https://tasker.joaoapps.com/userguide/en/javascript.html

bool running = taskRunning( str taskName )

名前付きタスクが現在実行中かどうかを調べます。タスク名が不明の場合、戻り値は false となります。

takeCall(電話に出る)

bool ok = takeCall();

Auto-accept an incoming call (if there is one).

https://tasker.joaoapps.com/userguide/en/javascript.html

bool ok = takeCall();

着信時に自動で電話に出ます。

takePhoto(写真を撮る)

bool ok = takePhoto( int camera, str fileName, str resolution, bool insertGallery )

Take a photo with the builtin camera.

  • camera: 0 = rear camera, 1 = front camera
  • resolution: format WxH e.g. 640×840
  • insertGallery: whether to insert the resulting picture in the Android Gallery application

See also: action Take Photo

https://tasker.joaoapps.com/userguide/en/javascript.html

bool ok = takePhoto( int camera, str fileName, str resolution, bool insertGallery )

内蔵のカメラで写真を撮ります。

  • camera(カメラ)パラメーター:0=背面カメラ、1=前面カメラ
  • resolution(解像度)パラメーター:横×縦で指定します。例)640×840
  • insertGallary(アルバムに追加)パラメーター:Androidのアルバムアプリに撮影した写真を追加するかどうかを指定します。

写真の撮影アクションの項もご覧下さい。

type(入力)

var ok = type( str text, int repeatCount )

Simulate keyboard typing.

Requires a rooted device.

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = type( str text, int repeatCount )

キーボード入力をシミュレートします。

端末がルート化されている必要があります。

unzip(解凍)

boolean ok = unzip( str zipPath, bool deleteZipAfter )

Unpack a Zip archive into the parent directory of the archive.

deleteZip causes the zip archive to be deleted after successful unpacking.

https://tasker.joaoapps.com/userguide/en/javascript.html

boolean ok = unzip( str zipPath, bool deleteZipAfter )

ZIP形式で圧縮されたファイルを同じ場所に解凍します。

deleteZip パラメーターを設定すると、正常に解凍された場合には解凍元のZIPファイルを削除します。

usbTether(テザリングの使用)

usbTether( bool set )

Enable or disable USB tethering.

See also: action USB Tether

https://tasker.joaoapps.com/userguide/en/javascript.html

usbTether( bool set )

USBテザリングの有効/無効を切り替えます。

USBテザリングアクションの項もご覧下さい。

usbTether( bool set )

Enable or disable USB tethering.

See also: action USB Tether

vibrate(振動)

vibrate( int durationMilliseconds )

Cause the device to vibrate for the specified time.

https://tasker.joaoapps.com/userguide/en/javascript.html

vibrate( int durationMilliseconds )

指定された時刻に端末を振動させます。

vibratePattern(振動パターン)

vibratePattern( str pattern )

Cause the device to vibrate following the specified pattern, which consists of a sequence of off then on millisecond durations e.g.

500,1000,750,1000

wait for 500ms, vibrates 1000ms, wait for 750ms, then vibrate for 1000ms.

https://tasker.joaoapps.com/userguide/en/javascript.html

vibratePattern( str pattern )

pattern パラメーターで指定されたパターンで端末を振動させます。このパラメーターはオン(振動する)時間とオフ(振動しない)時間の長さをミリ秒単位で指定します。例えば

500, 1000, 750, 1000

と指定した場合、500ミリ秒停止、1000ミリ秒振動、750ミリ秒停止、そして1000ミリ秒振動というパターンで振動します。

wait(待機)

wait( int durationMilliseconds )

Pause the script for the specified time.

Warning: may cause some preceeding functions not to complete in some situations. If in doubt, use JavaScript setTimeout() instead.

https://tasker.joaoapps.com/userguide/en/javascript.html

wait( int durationMilliseconds )

指定された時間スクリプトの実行を一時停止します。

注意:場合によっては実行中の関数が完了しない場合があります。そのような場合は、setTimeout() 関数を代わりに使用してください。

wifiTether(WiFiテザリング)

var ok = wifiTether( bool set )

Enable or disable Wifi tethering.

See also: action Wifi Tether

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = wifiTether( bool set )

WiFiテザリングの有効/無効を切り替えます。

WiFi Tetherアクションの項もご覧下さい。

var ok = wifiTether( bool set )

Enable or disable Wifi tethering.

See also: action Wifi Tether

writeFile(ファイルの書き込み)

var ok = writeFile( str path, str text, bool append )

Write text to file path.

If append is specified, the text will be attached to the end of the existing file contents (if there are any).

https://tasker.joaoapps.com/userguide/en/javascript.html

var ok = writeFile( str path, str text, bool append )

path パラメーターで指定されたファイルにテキストデータを書き込みます。

append パラメーターが指定されている場合、既存のテキスト(が有れば)の末尾にテキストが追加されます。

zip(圧縮)

boolean ok = zip( str path, int level, bool deleteOriginalAfter )

Zip a file or directory.

level is the desired compression level from 1-9, with 9 resulting in the smallest file and the longest compression time.

deleteOriginal causes path to be deleted if the zip operation is successful.

https://tasker.joaoapps.com/userguide/en/javascript.html

boolean ok = zip( str path, int level, bool deleteOriginalAfter )

ファイルまたはディレクトリを圧縮します。

level パラメーターには必要な圧縮レベルを1~9の範囲で指定します。9を指定すると圧縮後のファイルサイズは最も小さくなりますが、圧縮作業には最も時間がかかります。

deleteOriginal パラメーターを指定すると、圧縮が正常に行われた場合に指定されたファイル(ディレクトリ)が削除されます。

Notes

Audio Streams(オーディオストリーム)

Must be one of call, system, ringer, media, alarm or notification

https://tasker.joaoapps.com/userguide/en/javascript.html

call(通話)、system(システム)、ringer(着信)、media(メディア)、alarm(アラーム)または notification(通知)のいずれかです。

Colours(色)

Colours are specified in AARRGGBB hexadecimal format, with solid white being FFFFFFFF.

https://tasker.joaoapps.com/userguide/en/javascript.html

色の指定は、AARRGGBB形式の16進数で指定します。白は FFFFFFFF となります。

Colours are specified in AARRGGBB hexadecimal format, with solid white being FFFFFFFF.

File Paths(ファイルパス)

File paths can be specified as either absolute (start with /) or relative (don’t start with /).

Relative file paths are relative to the root of the internal storage media. So, for example, pics/me.jpg might resolve to /sdcard/pics/me.jpg.

https://tasker.joaoapps.com/userguide/en/javascript.html

ファイルパスの指定は絶対パス( / で始まる)または相対パス( / で始まらない)のいずれかで行います。

相対ファイルパスは内部ストレージメディアのルートに対して相対的な指定で、例えば pics/me.jpg という指定は /sdcard/pics/me.jpeg と解釈されます。