• 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
NSCannotCreateScriptCommandError (10)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSCannotCreateScriptCommandError (10)


  • Subject: NSCannotCreateScriptCommandError (10)
  • From: Steve Foster <email@hidden>
  • Date: Thu, 16 Dec 2004 18:19:46 +0000


Hi

I am going crazy with this and hopefully someone can point me in the right direction
I have a function which I will need to call a number of times so want to keep it separate and only write the piece of code once. What I want to work is this:

on choose menu item theObject
if the name of theObject is "Prefs" then
show window "Prefs"
readSettings() --This should then call the block of script below
end if
end choose menu item

on readSettings()
tell user defaults
set strTemplates to contents of default entry "DopTemplatesFolder" of user defaults
end tell
end readSettings

The trouble is it is giving me the following error:

NSCannotCreateScriptCommandError (10)


If a place the script inside the other statement as below it works fine but it is impractical as I need to call the same script in various places
on choose menu item theObject
if the name of theObject is "Prefs" then
show window "Prefs"
set strTemplates to contents of default entry "DopTemplatesFolder" of user defaults

end if
end choose menu item

I am working in Applescript Studio XCode 1.1

Any ideas

Thanks

Steve



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSCannotCreateScriptCommandError (10)
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Excel2004, System Events & NSReceiverEvaluationScriptError
  • Next by Date: Re: NSCannotCreateScriptCommandError (10)
  • Previous by thread: Re: Excel2004, System Events & NSReceiverEvaluationScriptError
  • Next by thread: Re: NSCannotCreateScriptCommandError (10)
  • Index(es):
    • Date
    • Thread