• 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
Re: NSAppleScript Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSAppleScript Problem


  • Subject: Re: NSAppleScript Problem
  • From: Marek Hrušovský <email@hidden>
  • Date: Fri, 27 Mar 2015 10:41:38 +1100

Have you tried executing the script?

// Execute the script, compiling it first if it is not already compiled.
Return the result of executing the script, or nil and a pointer to an error
information dictionary for failure.

- (NSAppleEventDescriptor *)executeAndReturnError:(NSDictionary
**)errorInfo;

On Fri, Mar 27, 2015 at 7:22 AM, Dave <email@hidden> wrote:

> Hi,
>
> I’m running the following Script from a Cocoa App using NSAppleScript:
>
> set myWindowName to "Test 2"
> set myNewSubject to "[High] Test 2"
> tell application id "com.microsoft.Outlook"
>         activate
>         save front window
>         set myMessageList to current messages
>         set myMessage to item 1 of myMessageList
>         set mySubject to the subject of myMessage
>         set the subject of myMessage to myNewSubject
>         save front window
> end tell
>
> The Script doesn’t work, e.g it doesn’t change the Subject field, however
> if I run it under the Script Editor it works ok.
>
> The Script compiles and runs with no errors from compileAndReturnError:
>
> Not sure why it doesn’t work and not sure where to start looking?
>
> All the Best
> Dave
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >NSAppleScript Problem (From: Dave <email@hidden>)

  • Prev by Date: Re: Inserting a task into the run loop
  • Next by Date: Re: Display an Alert Sheet at a Specified Screen Position
  • Previous by thread: NSAppleScript Problem
  • Next by thread: Re: NSAppleScript Problem
  • Index(es):
    • Date
    • Thread