GUI scripting a Save

I’m working on a script that reads files from a folder, opens each one in Keynote, and does a “save as…” to another location. Since Keynote isn’t scriptable, I’m using GUI scripting. I have the “open” working fine, and the “save” window coming up OK, but I’m having trouble getting save path entered for the file.

When I open the file I just send a CTRL-/ and put the full path to the file in the resulting sheet. But this doesn’t work when saving. CTRL-/ apparently is not an option.

So is my only option to use my file path to navigate the columns in the save window?

If so, the first button I need to click is “Macintosh HD” in the leftmost column. Using the UI Element Inspector I see that this is a button specified by:


<AXApplication: “Keynote”>
 <AXWindow: “Untitled 2”>
  <AXSheet>
   <AXGroup>
    <AXSplitGroup>
     <AXScrollArea>
      <AXRadioGroup>
       <AXButton: “Macintosh HD”>

The problem I’m running into drilling down to this UI element is the “split group”. Applescript doesn’t seem to recognize it as a keyword and wont compile with it in there.

Any ideas?

Thanks,

Dave

OK, I figured out that problem, applescript uses “splitter group”, not “split group”.

So now I have the click happening on “Macintosh HD” but now I can’t get the click happening on the folders in the next column. The items in this list are of type

<AXApplication: “Keynote”>
 <AXWindow: “Untitled 2”>
  <AXSheet>
   <AXGroup>
    <AXSplitGroup>
     <AXBrowser>
      <AXScrollArea>
       <AXScrollArea>
        <AXRadioGroup>
         <AXStaticText>

Static text appears not to have an action. So I’m stuck again.

Has anyone developed UI scripts for navigating the file browser?

Thanks,
Dave