4.2.10:File Selector Dialogs

ファイル選択ダイアログ

The file selector dialogs allow you to display the system standard dialogs. These dialogs allow the user to select a file or a set of files, select a directory, or specify a name and location to save a file.

ファイル選択ダイアログでは、システムの標準のダイアログを表示します。これらのダイアログを使って、ファイルの選択やディレクトリの選択、或はファイルの保存名と場所の指定をおこないます。

The syntax for bringing up the file selector dialogs mirrors the syntax for the alert and question dialogs detailed above. However unlike these dialogs, the file selector dialogs are displayed using the system standard dialogs where available. The notable exception at the time of this writing is Linux platform, where a built-in dialog is used instead due to more limited OS support. (You can force the other platforms to use this built-in stack based file selector by setting the systemFileSelector global property.)

ファイル選択ダイアログを表示するシンタックスは、上述したアラート・ダイアログやクエスチョン・ダイアログを表示させるシンタックスと同じです。ただこれらダイアログと違って、ファイル選択ダイアログは可能な場合にはシステムの標準のダイアログを表示します。このドキュメントを書いている時点での例外は、リナックス・プラットフォームで、このプラットフォームではOSの機能の関係でレヴォルーション組み込みのダイアログが使われます。(リナックス以外のプラットフォームでも、systemFileSelectorグローバル・プロパティを設定することで、このレヴォルーション組み込みのダイアログを強制的に使うことが可能です。)

Figure 23 – Answer File dialog for selecting a file

図23 ー ファイル選択用アンサー・ファイル・ダイアログ

all_img_56


answer file “Select a file:”
answer file "Select an image file:" with type "QuickTime Movies|mov" or type "All Files|"


The file path to the file selected by the user is returned in the
special variable it. If the user cancelled the dialog, that information will be returned by the result function.

選択されたファイルのパスは特別な関数 it に返されます。ダイアログがキャンセルされた場合には、その情報がresult関数に返されます。

For complete details on the syntax, see the answer
file with type in the Transcript Dictionary.

このシンタックスに関する詳細は、トランスクリプト辞書のfile with type項目をご覧下さい。

Figure 24 – Ask File dialog for saving a file

図24 ー ファイル保存用アスク・ファイル・ダイアログ

all_img_57


ask file “Save this document as:” with “Untitled.txt”
answer file "Select an image file:" with type "Text Files|txt" or type "All Files|"



The file path to the file to be saved is returned in the
special variable it. If the user cancelled the dialog, that information will be returned by the result function.

保存されるファイルのパスは、特別な変数 it に返されます。ダイアログをキャンセルした時には、その情報がresult関数に返されます。

For complete details on the syntax, see the ask
file with type in the Transcript Dictionary.

シンタックスに関する完全な記述は、トランスクリプト辞書のfile with type項目をご覧下さい。


Figure 25 – Answer folder dialog for choosing a directory


図25 ー ディレクトリ選択用アンサー・フォルダ・ダイアログ

all_img_58


answer folder “Please choose a folder:”
answer folder "Please choose a folder:" with “/root/default folder”



The file path to the folder selected by the user is returned in the
special variable it. If the user cancelled the dialog, that information will be returned by the result function.

ユーザーの選択したフォルダーへのパスは、特別な変数 it に返されます。ダイアログがキャンセルされると、その情報がresult関数に返されます。


For complete details on the syntax, see
answer folder in the Transcript Dictionary.
シンタックスに関する完全な記述は、トランスクリプト辞書のanswer folder項目をご覧下さい。