2016-03-29 3 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 item имеет object 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 
Смежные вопросы