4 Replies Latest reply on Sep 16, 2008 10:09 PM by (jacintha_mary)

    AppleScript GUI scripting problem.

      Hi All,

      I've created a script that will automatically open new document in Indesign CS2. But when i run the script i'm getting system events error as "NSReceiverEvaluationScriptError: 4". I tried following the instruction given in forums but still couldn't figure out. Below is the script i wrote. Can any one tell where and what i'm missing.

      tell application "Adobe InDesign CS2" to activate
      tell application "System Events"
      tell process "Adobe InDesign CS2"
      tell menu bar 1
      tell menu bar item "File"
      tell menu "File"
      tell menu item "New"
      tell menu "New"
      click menu item "Document"
      end tell
      end tell
      end tell
      end tell
      end tell
      click button "Ok" of window 1
      end tell
      end tell

      This is the submenu of menu New. This might be the problem cos the below script works for for which i'm clicking the menu not sub menu

      tell application "Adobe InDesign CS2" to activate
      tell application "System Events"
      tell application process "Adobe InDesign CS2"
      tell menu bar 1
      tell menu bar item "Help"
      tell menu "Help"
      click menu item "Welcome Screen..."
      end tell
      end tell
      end tell
      end tell
      end tell
      My Mac version 10.4.10
      Any help would be appreciated.

      -Jacintha