自動執行iSync同步 - MAC

By Regina
at 2008-04-10T13:35
at 2008-04-10T13:35
Table of Contents
推 uranusjr:AppleScript 可以, 不過我不太會用 iSync... 04/10 02:26
昨天邊看歐冠邊寫了一個
======
-- 把這個程式設成登入時執行
if application "iSync" is not running then
tell application "iSync" to run
delay 10
end if
tell application "iSync"
set lastSyncDate to last sync
quit
end tell
-- 檢查 iSync 有沒有在執行, 沒有的話執行
-- 讀入上次同步的時間
set dateNow to current date
-- 以上只會在本程式啟動時執行, 以下是迴圈
repeat
-- 每天更新現在日期
if dateNow is not (current date) then
set dateNow to current date
end if
-- 檢查現在是不是週日, 以及今天有沒有同步過
-- 如果沒有, 則執行 iSync, 同步, 然後更新上次同步時間
if dateNow is Sunday and lastSyncDate is not dateNow then
tell application "iSync"
run
delay 3
synchronize
repeat while syncing is true -- 這邊改了
delay 1
end repeat
set lastSyncDate to last sync
quit
end tell
end if
-- 六小時(21600 秒)之後再回來重作一次
delay 21600
end repeat
======
我不太用 iSync, AppleScript 也不算太熟
希望可以提供參考, 如果有砂鍋大的 bug 也請提出來
(我甚至不確定 delay 21600 行不行得通 orz)
--
我承認只是想練習一下...
--
Tags:
MAC
All Comments

By Catherine
at 2008-04-12T06:59
at 2008-04-12T06:59

By David
at 2008-04-14T01:00
at 2008-04-14T01:00

By Noah
at 2008-04-17T10:55
at 2008-04-17T10:55

By Ida
at 2008-04-20T01:56
at 2008-04-20T01:56

By Odelette
at 2008-04-21T15:39
at 2008-04-21T15:39

By Rae
at 2008-04-25T00:56
at 2008-04-25T00:56
Related Posts
CrossOver

By Kelly
at 2008-04-09T12:37
at 2008-04-09T12:37
ical <-- google calendar <--> sunbird 同步行事曆

By Cara
at 2008-04-09T11:38
at 2008-04-09T11:38
CrossOver

By Bennie
at 2008-04-08T23:29
at 2008-04-08T23:29
CrossOver

By Annie
at 2008-04-08T19:07
at 2008-04-08T19:07
RMVB 轉檔

By Delia
at 2008-04-06T20:23
at 2008-04-06T20:23