このAppleScriptを実行しようとすると問題が発生しました。 このapplescriptの目的は、ファイルをシングルクリックしてこのスクリプトを実行すると、自動的にこのファイルを "david"という名前のブルートゥース上のデバイスに転送することです。しかし、私は弱ったラインで問題に遭遇しました。結果は次のとおりです。ブルートゥースのAppleScript自動ファイル転送
"エラー"システムイベントにエラーが発生しました:プロセス\ "Bluetooth File Exchange \"のウィンドウ1のスクロール領域\ "Bluetooth Devices \"を取得できません。 "-1728スクロール領域" Bluetoothファイル交換 "のウィンドウ1の" Bluetoothデバイス ""
と私はなぜわかりません。私はまったく別の人が書いたスクリプトですが、ちょっと変えてちょっと追加しました。 誰も助けてもらえますか?コードのタイプミスを指摘
property device : "david"
tell application "Finder" to set fileAlias to selection as alias
set fileToSend to fileAlias
tell application "Finder" to open fileToSend using application file id "com.apple.BluetoothFileExchange"
activate application "Bluetooth File Exchange"
tell application "System Events"
tell process "Bluetooth File Exchange"
repeat until exists window 1
end repeat
select (1st row of table of scroll area "Bluetooth Devices" of window 1 whose value of text field 1 is device)
click button "Send" of window 1
end tell
end tell
問題が解決されました、ありがとう「pbell」。
以下のコードは、それがあまりにも遅い実行している)。このコードの問題は
1あるブルートゥース4.4.4
property device : "vivo X5Pro D"
tell application "Finder" to set fileAlias to selection as alias
set fileToSend to fileAlias
tell application "Finder" to open fileToSend using application file id "com.apple.BluetoothFileExchange"
activate application "Bluetooth File Exchange"
tell application "System Events"
tell process "Bluetooth File Exchange"
repeat until exists window 1
end repeat
select ((row 1 of table 1 of scroll area 1 of window 1) whose value of UI element 2 of UI element 1 is device)
click button "Send" of window 1
end tell
end tell
のために働く修正版です。
2)コードにはGUIが含まれているため、いくつかの領域の変更された位置でシステムを更新すると、このコードが駄目になります。 (ありがとうpbell)
GUIとコマンドを直接バイパスする方法はありますか?私はこれが実行時間を短縮すると思います。 :)あなたはおそらく、あなたの現在のスクリプトで2課題いる
誰もが少しの時間を過ごすことができます私のスクリプトの表情に洞察力を共有するための –