アドホックモード切替
PdaNetを便利に使いこなすアドホックモード作成のワンタッチアプリの決定版を見つけました。海外の掲示板にポストされていたので、そっくり使わせてもらっても大丈夫かなと思います。AppleScriptで出来ていて、私の拙いAutomator版より1000倍は速いです。(笑)
注意点としては、Mac側に作るDHCP参照モードのネットワーク環境とアドホックのSSIDは同じにする点とパスワードは128ビットのアスキー13文字で入力するという点です。(作者がそのように作ってある)以下がそのスクリプトになります。これをAppleScriptのアプリ形式にするか、AutomatorのAppleScriptの実行を使ってアプリにして使います。
私は行きがかり上、Automatorにしてみました。ソースは下記の通りです。
property NetworkName : "iPhonePdaNet"
property NetworkPassword : "1234567890123"
property CreateMenuName : "ネットワークを作成..."
try
do shell script "/usr/sbin/scselect " & NetworkName
delay 2
end try
tell application "System Events"
tell process "SystemUIServer"
tell menu bar 1
set menu_extras to value of attribute "AXDescription" of menu bar items
repeat with the_menu from 1 to the count of menu_extras
if item the_menu of menu_extras is "AirMac Menu Extra" then exit repeat
end repeat
tell menu bar item the_menu
perform action "AXPress"
delay 0.2
perform action "AXPress" of menu item CreateMenuName of menu 1
end tell
end tell
repeat until exists window 1
delay 0.5
end repeat
tell window 1
keystroke NetworkName
click checkbox 1
keystroke NetworkPassword
keystroke tab
keystroke NetworkPassword
click pop up button 2
click menu item 2 of menu 1 of pop up button 2
delay 0.5
click button 1
end tell
end tell
end tell
です。(済みません、字下げが出来なかった)根本的にAppleScriptの構文を理解している訳ではないので、上記の通りにしたら動いたというレベルだとご理解ください。「NetworkName」にMacのネットワーク環境名とアドホックのSSIDの名称(同じもの)を入れることと、13文字のアスキーが「NetworkPassword」になることと(作者がWEP128bitで作成してるから)、「CreateMenuName」の”ネットワークを作成..." の "..."は半角のピリオド3つということが注意点です。
本当に爆速で切り替わるので気持ちいいくらいです。ワンタッチで切り替わるので、PdaNetの使用頻度が増えてしまいそうですね。
注意点としては、Mac側に作るDHCP参照モードのネットワーク環境とアドホックのSSIDは同じにする点とパスワードは128ビットのアスキー13文字で入力するという点です。(作者がそのように作ってある)以下がそのスクリプトになります。これをAppleScriptのアプリ形式にするか、AutomatorのAppleScriptの実行を使ってアプリにして使います。
私は行きがかり上、Automatorにしてみました。ソースは下記の通りです。
property NetworkName : "iPhonePdaNet"
property NetworkPassword : "1234567890123"
property CreateMenuName : "ネットワークを作成..."
try
do shell script "/usr/sbin/scselect " & NetworkName
delay 2
end try
tell application "System Events"
tell process "SystemUIServer"
tell menu bar 1
set menu_extras to value of attribute "AXDescription" of menu bar items
repeat with the_menu from 1 to the count of menu_extras
if item the_menu of menu_extras is "AirMac Menu Extra" then exit repeat
end repeat
tell menu bar item the_menu
perform action "AXPress"
delay 0.2
perform action "AXPress" of menu item CreateMenuName of menu 1
end tell
end tell
repeat until exists window 1
delay 0.5
end repeat
tell window 1
keystroke NetworkName
click checkbox 1
keystroke NetworkPassword
keystroke tab
keystroke NetworkPassword
click pop up button 2
click menu item 2 of menu 1 of pop up button 2
delay 0.5
click button 1
end tell
end tell
end tell
です。(済みません、字下げが出来なかった)根本的にAppleScriptの構文を理解している訳ではないので、上記の通りにしたら動いたというレベルだとご理解ください。「NetworkName」にMacのネットワーク環境名とアドホックのSSIDの名称(同じもの)を入れることと、13文字のアスキーが「NetworkPassword」になることと(作者がWEP128bitで作成してるから)、「CreateMenuName」の”ネットワークを作成..." の "..."は半角のピリオド3つということが注意点です。
本当に爆速で切り替わるので気持ちいいくらいです。ワンタッチで切り替わるので、PdaNetの使用頻度が増えてしまいそうですね。


