1
我使用此腳本在新選項卡中打開一個URL,但我希望它在當前選項卡中打開。有沒有辦法做到這一點?有沒有辦法通過Applescript在Firefox的當前標籤中打開一個url?
tell application "Firefox"
open location "http://www.yubnub.org"
end tell
我使用此腳本在新選項卡中打開一個URL,但我希望它在當前選項卡中打開。有沒有辦法做到這一點?有沒有辦法通過Applescript在Firefox的當前標籤中打開一個url?
tell application "Firefox"
open location "http://www.yubnub.org"
end tell
Firefox的Applescript支持似乎並不存在。
使用系統事件和擊鍵嘗試此解決方法。
tell application "Firefox"
activate
set the clipboard to "http://www.yubnub.org"
tell application "System Events"
keystroke "l" using {command down}
keystroke "v" using {command down}
key code 36 -- return key
end tell
end tell
謝謝。它的工作,這正是我想要做的。 – Elias