Keynote save problem

Hello,

I have a problem with the saving of presentations in Keynote.
In the past there was a topic on this forum with a code to save a presentation in Keynote. This is working but after saving the presentation there is a problem.
This is what happen’s in the script.

  1. Opening the file beelschermrapportage.key by the script.
  2. Changing many values in the presentation with user input.
  3. He create’s a filename, for example: testpresentation.key and he is saving this on the desktop.
    → To this point everything works fine and the file is saved.

If I go work on the presentation what is of course still opened, he works on the file beeldschermrapportage.key and not on the file that he just have saved.

This is the part of the script that saves the presentation:


...
	set naam to (((path to desktop) as Unicode text) & naam)
	tell application "Keynote"
		set myslideshow to slideshow 1
		save myslideshow in naam
	end tell
...

I hope somebody can help me!

P.s. sorry for my bad English!

Hi karsten,

If you just want to save the existing keynote in its original location, then you do not need to provide a file path:


tell application "Keynote"
	set myslideshow to slideshow 1
	save myslideshow
end tell

In case you want to save the modified original keynote in a different location and further work on this version, then you can close the original keynote and open the one just saved:


set filename to (((path to desktop) as Unicode text) & "Test.key")
tell application "Keynote"
	set myslideshow to slideshow 1
	save myslideshow in filename
	close myslideshow
	open (filename as alias)
end tell

Maybe this helps? I hope so!

Thanks for the reply! This solution is working great.