Đây là giải pháp một phần. Điều này sẽ mở ra cửa sổ gỡ lỗi của Safari với một cú nhấp chuột tốt hơn nhiều nhưng không tự động.
mở Script Editor
trên mac của bạn (Command + Space Bar và gõ vào Script Editor)
Dán trong mã này:
-- `menu_click`, by Jacob Rus, September 2006
--
-- Accepts a list of form: `{"Finder", "View", "Arrange By", "Date"}`
-- Execute the specified menu item. In this case, assuming the Finder
-- is the active application, arranging the frontmost folder by date.
on menu_click(mList)
local appName, topMenu, r
-- Validate our input
if mList's length < 3 then error "Menu list is not long enough"
-- Set these variables for clarity and brevity later on
set {appName, topMenu} to (items 1 through 2 of mList)
set r to (items 3 through (mList's length) of mList)
-- This overly-long line calls the menu_recurse function with
-- two arguments: r, and a reference to the top-level menu
tell application "System Events" to my menu_click_recurse(r, ((process appName)'s ¬
(menu bar 1)'s (menu bar item topMenu)'s (menu topMenu)))
end menu_click
on menu_click_recurse(mList, parentObject)
local f, r
-- `f` = first item, `r` = rest of items
set f to item 1 of mList
if mList's length > 1 then set r to (items 2 through (mList's length) of mList)
-- either actually click the menu item, or recurse again
tell application "System Events"
if mList's length is 1 then
click parentObject's menu item f
else
my menu_click_recurse(r, (parentObject's (menu item f)'s (menu f)))
end if
end tell
end menu_click_recurse
menu_click({"Safari", "Develop", "IOS Simulator", "index.html"})
Khi mô phỏng đã mở ra, bấm chạy trên kịch bản của bạn (bạn có thể cần cho phép trình chỉnh sửa tập lệnh trong cài đặt lần đầu tiên).
(Tùy chọn) Bạn có thể lưu tập lệnh dưới dạng ứng dụng để bạn không phải mở trình chỉnh sửa tập lệnh.
(câu trả lời này là một phiên bản chi tiết hơn về câu trả lời trước Galatin của)
Nguồn
2015-04-23 14:37:07
Để có giải pháp dễ dàng hơn, hãy thử vào 'Tùy chọn hệ thống> Bàn phím> Phím tắt' và thêm" Lối tắt ứng dụng "cho Safari cho tiêu đề menu 'localhost' hoặc bất kỳ URL nào của bạn trông giống như trong menu Phát triển. –