objective c - Mail: Application isn't running -


i'm trying execute simple applescript in objective-c. code is:

nsstring *emailstring = @"tell application \"mail\" activate";  nsapplescript *emailscript = [[nsapplescript alloc] initwithsource: emailstring];  nsdictionary *errordict = null;  [emailscript executeandreturnerror: &errordict]; 

and got annoying error:

nsapplescripterrormessage: mail got error: application isn’t running. nsapplescripterrorrange: nsrange: {27, 8} nsapplescripterrorbriefmessage: application isn’t running. nsapplescripterrornumber: -600 nsapplescripterrorappname: mail

it's no problem if execute script script editor. need — thanks!

solved. app using sandbox. , if want run applescript it, need edit entitlements file. in me case this help.


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -