0

I am trying to see if i can change the text of some slides inside a keynote presentation that has already been created but i am having problems just opening it to begin with.

here is my current simple applescript:

set thisFile to "Users/myUserName/Desktop/KeynoteAppleScript.key"

    tell application "Keynote"

        activate

        open thisFile

        show slide 1

  end tell

I get an error stating that the file I am trying to open :

"Users/myUserName/Desktop/KeynoteAppleScript.key" couldnt be opened because there is no such file".

Thats obviously not correct, it is there and the i have double checked the name of the file to verify.

I am using Keynote 6.5.2

Script Editor Version 2.7, AppleScript 2.4

What am I doing wrong here?

1 Answer 1

1

Try adding a leading fwd slash to the path

e.g,

set thisFile to "/Users/myUserName/Desktop/KeynoteAppleScript.key"

I needed to do this to get it opening on 10.8, Keynote 5.3

ALSO..

When in doubt with a file path, try dragging the file from the desktop to the script window and it will insert a correct path.

7
  • i've tried this as well. still same error. I don't get this at all. I am using Yosemite (10.10)
    – cspam
    Jan 15, 2015 at 0:10
  • Wierd. Maybe try casting to a Posix file first? e.g, set thisFile to POSIX file "/..."
    – adamh
    Jan 15, 2015 at 0:34
  • I get an 'AppleEvent timed out' pop up error. It just seems to run and run until it times out. It starts up Keynote, it is just not opening the specific keynote file.
    – cspam
    Jan 15, 2015 at 0:42
  • Actually if i put the first forward slash in it tells me the file cannot be found. So i took that back out for it to get to the point of giving me that pop up error. Maybe that was just coincidence, sometimes it just times out and sometimes i just get the 'file not found'
    – cspam
    Jan 15, 2015 at 0:49
  • Try dragging said file from Desktop to script window and it will insert a path for you, just to double check you got it 100% ??
    – adamh
    Jan 15, 2015 at 0:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.