Saturday, February 7, 2015

My First Applescript

Just tried to execute some Applescript code which was about opening up OpenOffice application and start slide show.

#!/usr/bin/osascript

-- Name of the presentation
set presentationName to "T-Notifications.pptx"

-- Create a full path the presentation
set myPresentation to (("/Users/rr/Downloads/") & presentationName)

-- launch PowerPoint and bring the application to the front
tell application "OpenOffice"
activate
-- open the presentation in PowerPoint
open myPresentation
-- run the presentation, looping until the Mac is shut down
-- set «class lUSp» of «class SSSt» of «class AAPr» to true
-- «event sPPTRSsH» «class SSSt» of «class AAPr»

end tell

Just copy this on to a text pad and save it as scpt. Open this in Applescript Utility and run it. This looks for presentation in the Downloads directory of Mac. 

References:
self.

No comments:

Post a Comment