2016-03-29 125 views
0
tell application "Keynote" 
     repeat 
      delay 2 -- seconds. This script does not need to run faster 
      set the_time to current date 
      set the_time to time string of (current date) -- get now() 
      set the_time to every word of the_time -- slice 
      set the_time to item 1 of the_time & ":" & item 2 of the_time -- extract fields 
      set body of the first slide to the_time as string 
     end repeat 
    end tell 
end tell 

我想在幻燈片1(在這種情況下)在Keynote中顯示當前時間。我發現它應該與applescript一起工作,因爲這個未來在Keynote中不被支持。當前時間顯示在Keynote vie Applescript

「AppleScript的說,‘主題演講’發送錯誤:幻燈片1的身體無法在類型說明符轉換 所以這是一個問題」 set body of the first slide to the_time as string」,但我不認爲這

回答

0
  • 應用Keynote具有documents
  • document具有slides
  • slide具有text items
  • text itemobject text

嘗試

repeat 
    delay 2 -- seconds. This script does not need to run faster 
    set the_time to text 1 thru -4 of time string of (current date) 
    tell application "Keynote" 
     set object text of text item 1 of first slide of document 1 to the_time 
    end tell 
end tell