昨天在圖書館借閱此書,幾點隨想:
一 內容對應了 Jaguar;資訊很新。
二 原來所有 cocoa 程式皆可自訂快速鍵,舉列:
%defaults write com.apple.safari NSUserKeyEquivalents '{"Clear History" = "$@1";}'
其中
safari - cocoa 程式的名稱
Clear History - 程式的 menu 內的項目
$@1 - shift + command + 1
$ - shift key
^ - control key
~ - option key
@ - command key
結束 Safari、再啟動之,便可按 shift + command + 1 來 clear history。
三 值得一看的入門書。
書評 - The Missing Manual Mac OS X Second Edition
版主: ross_tt、bryanchang、digdog、chester
- bryanchang
- 討論區管理員
- 文章: 7057
- 註冊時間: 04/19/2001 1:01 am
- 來自: The '60s
- 聯繫:
是此地的公共圖書館:香港公共圖書館
可經這網頁查詢圖書館有什麼藏書:圖 書 館 聯 機 目 錄
剛看完 Cocoa Programming for Max OS X ,手上還有 Carbon Proramming ( 大部份內容皆看不懂
)、中日韓越資訊處理 ( 希望了解亂碼的源由及應對方法 )。
免費的資源,不可不善用
可經這網頁查詢圖書館有什麼藏書:圖 書 館 聯 機 目 錄
剛看完 Cocoa Programming for Max OS X ,手上還有 Carbon Proramming ( 大部份內容皆看不懂
免費的資源,不可不善用
我可不可能按個鍵就選擇encoding是繁體中文?
較便捷的,試試選繁體中文為 default Encoding。cocoa 程式自訂的快速鍵只對應第一層的指令 ( 不確定,有待查核。)
或使用 applescript 的 UI scripting;編譯以下指令,儲存為 stay open 的 application:
代碼: 選擇全部
on run
try
my do_submenu("Safari", "View", "Text Encoding", "Traditional Chinese (Mac OS)")
end try
end run
on reopen
run
end reopen
on do_submenu(app_name, menu_name, menu_item, submenu_item)
try
-- bring the target application to the front
tell application app_name
activate
end tell
tell application "System Events"
with timeout of 300 seconds -- 5 minutes
tell process app_name
tell menu bar 1 -- menu bar
tell menu menu_name -- menu
tell menu item menu_item -- menu item
tell menu 1 -- sub-menu
click menu item submenu_item -- sub-menu item
end tell
end tell
end tell
end tell
end tell
end timeout
end tell
return true
on error error_message
return false
end try
end do_submenu
此程式會在 dock 佔一位置,每次點擊時,最上層的 Safari 視窗會改以 繁體中文 來顯示網頁。
或,儲存為 compiled script;用 DragThing、Youpi Key 或 Sony Ericsson Clicker 等,按鍵觸發之。
