2016-03-29 92 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