PowerPoint to Keynote AppleScript

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

PowerPoint to Keynote AppleScript Wed May 11, 2011 1:30 am • by mpa15
Hi All,

I would like Hazel to open powerpoint lectures in keynote, save them, (and possibly delete the original powerpoint?). So far I have written the AppleScript below, but it doesn't seem to work. Any suggestions would be much appreciated, thanks in advance.

Regards,

Maksim

[applescript]
set theFolder to (path to Dropbox) as text
set theDestinationFolder to (theFolder) & "Summer 2011:" & "Bio"
tell application "Keynote"
open theFile
set theSlideshow to slideshow 1
set theDestinationPath to theDestinationFolder & (name of theSlideshow)
save theSlideshow in theDestinationPath
close theSlideshow
end tell
[/applescript]
mpa15
 
Posts: 13
Joined: Wed May 11, 2011 1:24 am

Re: PowerPoint to Keynote AppleScript Wed May 11, 2011 9:33 am • by Mr_Noodle
You should check the logs and post what error is being logged there. To view the logs, go to the "Info" section and click on the "View Log" button.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: PowerPoint to Keynote AppleScript Wed May 11, 2011 11:38 am • by mpa15
Thanks for the quick reply! Here's what I found in the log:

}
2011-05-10 22:20:07.683 (null)[0] 3.ppt: Rule ppt matched.
2011-05-10 22:20:10.389 hazelfolderwatch[94159] [Error] AppleScript failed: Error executing AppleScript on file /Users/mpa15/Dropbox/Summer 2011/Bio/3.ppt.
2011-05-10 22:20:10.390 hazelfolderwatch[94159] AppleScript error: {
OSAScriptErrorAppName = Keynote;
OSAScriptErrorBriefMessage = "Can\U2019t get slideshow \"3\".";
OSAScriptErrorMessage = "Keynote got an error: Can\U2019t get slideshow \"3\".";
OSAScriptErrorNumber = -1728;
OSAScriptErrorRange = NSRange: {0, 0};
}
mpa15
 
Posts: 13
Joined: Wed May 11, 2011 1:24 am

Re: PowerPoint to Keynote AppleScript Wed May 11, 2011 11:39 am • by Mr_Noodle
It says it can't get slideshow 3 so that's something you might want to debug in AppleScript Editor first before using it in Hazel. Once you have it compiling and running there, you can port it over.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support