Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456 サンプルのページ
tell application "Finder"
set zoomed of Finder window 1 to true
end tell
最前面のウインドウをズームする(Finder)
ウインドウを閉じる
tell application "Finder"
close Finder window 1
end tell
最前面のウインドウを閉じる(Finder)
tell application "Finder"
close every Finder windows
end tell
全てのウインドウを閉じる(Finder)
ウインドウをドックに格納する
tell application "Finder"
set collapsed of Finder window 1 to true
end tell
最前面にあるウインドウをドックに格納する(Finder)
tell application "Finder"
set collapsed of every Finder window to true
end tell
全てのウインドウをドックに格納する(Finder)
ウインドウの表示をアイコンビューに変更
tell application "Finder"
set current view of Finder window 1 to icon view
end tell
最前面のウインドウの表示をアイコンビューに変更する(Finder)
ウインドウの表示をリストビューに変更
tell application "Finder"
set current view of Finder window 1 to list view
end tell
最前面のウインドウの表示をリストビューに変更する(Finder)
ウインドウの表示をカラムビューに変更
tell application "Finder"
set current view of Finder window 1 to column view
end tell
最前面のウインドウの表示をカラムビューに変更する(Finder)
アイコンビューのオプションを変更する
tell application "Finder"
set current view of Finder window 1 to icon view
set arrangement of icon view options of Finder window 1 to snap to grid
end tell
最前面のウインドウを「グリッドに沿う」にする。「snap to grid」を変更することでオプションを変更できる。用語辞書には「not arranged/snap to grid/arranged by name/arranged by modification date/arranged by creation date/arranged by size/arranged by kind/arranged by label」がある。(Finder)
アイコンビューでアイコンの大きさを変える
tell application "Finder"
set current view of Finder window 1 to icon view
set icon size of icon view options of Finder window 1 to 48
end tell
最前面のウインドウのアイコンの大きさを変える。「48」の部分は16〜128の間。(Finder)
リストビューでフォルダのサイズも表示する
tell application "Finder"
set current view of Finder window 1 to list view
set calculates folder sizes of list view options of Finder window 1 to true
end tell
最前面のウインドウでフォルダのサイズを表示する。(Finder)
リストビューでアイコンの大きさを変える
tell application "Finder"
set current view of Finder window 1 to list view
set icon size of list view options of Finder window 1 to large icon
end tell
tell application "Finder"
set current view of Finder window 1 to list view
set sort column of list view options of Finder window 1 to name column
end tell
数値ではなく「name column」などでも指定できる。用語辞書には「name column/modification date column/creation date column/size column/kind column/label column/version column/comment column」がある。label columnは未実装。(Finder)
リストビューで,全てのカラムを表示する
tell application "Finder"
set current view of Finder window 1 to list view
set visible of columns of list view options of Finder window 1 to true
end tell
(Finder)
リストビューで,特定のカラムを表示/非表示
tell application "Finder"
set current view of Finder window 1 to list view
set visible of column 3 of list view options of Finder window 1 to false
end tell
「column 3」の「3」を変更すると変更日や作成日などの表示/非表示を切り替えられる。1が名前,2が変更日,3が作成日,4がサイズ,5が種類,6がラベル,7がバージョン,8がコメント。カラム名(creation date columnなど)での指定は駄目な模様。(Finder)
リストビューで相対日時を使う/使わない
tell application "Finder"
set current view of Finder window 1 to list view
set uses relative dates of list view options of Finder window 1 to true
end tell
display dialog "Hello!" default answer "Bye"
set myResult to text returned of result
あるいは
set myResult to text returned of (display dialog "Hello!" default answer "Bye")
display dialog "Hello!" buttons {"A", "B", "C"} default button 3
set button_returned to button returned of result
if button_returned is "A" then
--ボタンAがクリックされたときの処理
else if button_returned is "B" then
--ボタンBがクリックされたときの処理
else
--ボタンCがクリックされたときの処理
end if
set saveFile to choose file
open for access saveFile with write permission
set theEOF to get eof saveFile
write "Hello!" to saveFile starting at theEOF + 1
close access saveFile
get eofでファイルの末尾を得る。それに1を足した位置からデータを書き込む(Standard Additions)
ファイルにデータを上書きして書き込む
set saveFile to choose file
open for access saveFile with write permission
set eof saveFile to 0
write "Hello!" to saveFile
close access saveFile
year of (current date)--2003
month of (current date)--February
day of (current date)--18
weekday of (current date)--Tuesday
time of (current date)--43126
date string of (current date)--"2003年 2月 18日 火曜日"
date string of (current date)--"11:58:14"
repeat
display dialog "Enter your e-mail address." default answer "" with icon note
set mail_add to text returned of result
if (mail_add contains "@") and (mail_add contains ".") then
exit repeat
end if
end repeat
on open selectItem
repeat with eachItem in selectItem
tell application "Finder"
display dialog name of eachItem as Unicode text
end tell
end repeat
end open