最新版 NUMBERS 可以自動更新股價+匯率

Numbers剛剛升級,發現了一個很棒的新功能,可以自動連線更新試算表內的股價和匯率,不用再一個一個慢慢key~~




最新版 NUMBERS 可以自動更新股價+匯率
最新版 NUMBERS 可以自動更新股價+匯率
最新版 NUMBERS 可以自動更新股價+匯率
最新版 NUMBERS 可以自動更新股價+匯率
才2個多月,現在這個stock quote功能在numbers升級改版後,變得不太棒了~~
改版前,可以近乎即時的股價更新,現在只能收到前一天的收盤價~~
還有,價格也有出現錯誤的~~

在APPLE官網討論區裏有高人釋出一個AppleScript,可以用這個Script來擷取近乎即時的股價
我試過非常好用,想更新股價,自己按一鍵執行script即可
股價跌太多,不想更新,那就不按了~


1. 先在試算表中建立一個表格如下,欄A填入自己的股價代號,代號要跟在Yahoo Finance上的一致,表格最後不能有空白行

ex: TSMC 是 2330.TW
ND8U.SI
0005.HK



2. Copy-paste 底下 script 到 Script Editor (Applications > Utilities).

3. 確定你的sheet和表格的名稱與script中的名稱一致。

4. 在script editor 按下那個三角形 'run' button.

5. 存檔,Done!
(If "nothing happens" make sure you've enabled Script Editor.app at System Preferences > Security and Privacy > Accessibility).

要更新的表格在run script之前,先打開在桌面上!





+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

set {d, s, t} to {1, "My Sheet", "My Quotes"}
-- front doc, sheet named "My Sheet", table named "My Quotes"

set quoteProps to "l1" -- For more props see http://www.jarloo.com/yahoo_finance/
set baseURL to "http://download.finance.yahoo.com/d/quotes.csv?"

tell application "Numbers" to tell document d's sheet s's table t
set theSymb to column 1's (cells 2 thru -1)'s value
set AppleScript's text item delimiters to "+"
set theSymb to "s=" & theSymb
set quoteProps to "&f=" & quoteProps
set the clipboard to (do shell script "curl -s " & (baseURL & theSymb & quoteProps)'s quoted form)
set selection range to range "B2"
activate
tell application "System Events" to keystroke "v" using {option down, shift down, command down}
end tell
這個script 多天前開始回傳錯誤了
目前還沒有修正版

宮保GG wrote:
才2個多月,現在這...(恕刪)
文章分享
評分
評分
複製連結

今日熱門文章 網友點擊推薦!