• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
correct script won't compile in XCode???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

correct script won't compile in XCode???


  • Subject: correct script won't compile in XCode???
  • From: Marion Dickten <email@hidden>
  • Date: Thu, 18 Apr 2013 12:46:28 +0200

Hello,

I've got this script which compiles perfectly in ScriptEditor and does what I want:

set ebenen to {"Nonstandard", "Nichtstandard"}

tell the application "Adobe InDesign CS6"
close every document -- OK
open file f
tell document 1
repeat with ebene in ebenen
if exists layer ebene then
set the visible of layer ebene to false
else
set theErrorMessage to "Ebene " & ebene & " existiert nicht."
end if
end repeat
close saving yes
end tell
end tell

Now I add this bit to my ASObjC app (which already has a working branch of the same code for QuarkXPress):

tell the application "Adobe InDesign CS3"
                        open file datei
                        tell document 1
                            if theAction is "ausblenden" then
                                repeat with ebene in ebenen
                                    if exists layer ebene then
                                        set the visible of layer ebene to false
                                    else
                                        set theErrorMessage to "Ebene " & ebene & " existiert nicht."
                                    end if
                                end repeat
                            else
                                repeat with ebene in ebenen
                                    if exists layer ebene then
                                        delete layer ebene
                                    else
                                        set theErrorMessage to "Ebene " & ebene & " existiert nicht."
                                    end if
                                end repeat
                            end if
                            close saving yes
                        end tell
                    end tell

… and it won't compile. The variable ebenen is a list of strings initialised earlier in the code, exactly as in the ScriptEditor code.  XCode complains that

EbenenManipulieren/AppDelegate.applescript:113: error: Expected “then”, etc. but found identifier. (-2741)

and line 113 is the one saying if exists layer ebene then . If I remove the if-clause XCode complains about the next line saying that 

EbenenManipulieren/AppDelegate.applescript:114: error: A identifier can’t go after this identifier. (-2740) 

How could this happen? It seems as if XCode thinks layer isn't a keyword at all! And now, what do I do? Is there any workaround?

Marion
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Enable button if text field nonempty in ASObjC
  • Next by Date: Re: correct script won't compile in XCode???
  • Previous by thread: Re: Enable button if text field nonempty in ASObjC
  • Next by thread: Re: correct script won't compile in XCode???
  • Index(es):
    • Date
    • Thread