--p2で書き込む(別窓用).scpt on run tell application "BathyScaphe" if class of front document is document then set temptext to URL of front document set temprecoad to thread attributes of front document else beep end if end tell
set AppleScript's text item delimiters to "/" set temparray to text items of temptext
tell application "Safari" open location ("http://p2.2ch.net/p2/post_form.php?host=" & item 3 of temparray & "&bbs=" & item 6 of temparray & "&key=" & item 7 of temparray & "&rescount=" & (get |Count| of temprecoad)) end tell end run
ついでに --p2で開く(別窓用).scpt on run tell application "BathyScaphe" if class of front document is document then set temptext to URL of front document set temprecoad to thread attributes of front document else beep end if end tell
set AppleScript's text item delimiters to "/" set temparray to text items of temptext
tell application "Safari" open location ("http://p2.2ch.net/p2/read.php?host=" & item 3 of temparray & "&bbs=" & item 6 of temparray & "&key=" & item 7 of temparray) end tell
on run set tempID to null tell application "BathyScaphe" set tempID to id of front window if document of front window is not reply document then set temprecoad to thread attributes of front document set tempcount to get |Count| of temprecoad set msg_1 to "スレッド " & (name of front window) & " のオートリロードを" & (interval as string) & "秒間隔で開始します。" set msg_2 to "何も操作をしないと、10秒後に自動的にオートリロードを開始します。オートリロードを止めるときは、このスクリプトを終了してください。" display alert msg_1 message msg_2 buttons {"開始"} default button 1 giving up after 10 --Tiger ではこっちの方がいい --display dialog msg_1 & return & msg_2 buttons {"開始"} default button 1 giving up after 10 end if end tell end run
on idle tell application "BathyScaphe" repeat with eachWin in windows if id of eachWin is tempID then reload thread (document of eachWin) set temprecoad to thread attributes of (document of eachWin) set newCount to get |Count| of temprecoad if tempcount is not newCount then activate beep display dialog (get |Title| of temprecoad) & "に新しい書き込みがありました。" buttons {"OK"} end if set tempcount to newCount end if end repeat end tell return interval end idle