stuck trying to build plist
Roy Nielsen <[email protected]> Fri, 11 Oct 2013 10:14:23 -0600
| Newsgroups | gmane.comp.python.pyobjc.devel |
|---|---|
| Message-ID | <CANEVmA=n=1W0D6u5v0vAS0WqBx3P0d7ad2SeQMOjdLjysp-Zjg@mail.gmail.com> |
Hello, I'm trying to use SMJobSubmit - trying to convert the example at : http://www.stairways.com/blog/2012-08-06-smjobsubmit to python using pyobjc... I've gotten this far: 18 mylabel = "gov.lanl.example" 19 20 authItem = [kSMRightBlessPrivilegedHelper, 0, None, 0] 21 authRights = [1, authItem] 22 flags = kAuthorizationFlagInteractionAllowed | kAuthorizationFlagPreAuthorize | kAuthorizationFlagExtendRights 23 24 auth = None 25 26 if AuthorizationCreate(authrights, kAuthorizationEmptyEnvironment, flags, auth ) == errAuthorizationSuccess : 27 SMJobRemove(kSMDomainSystemLaunchd, mylabel, auth, false, NULL) 28 29 ##### 30 # To load a plist into a dictionary: 31 #plist = NSMutableDictionary.dictionaryWithContentsOfFile_(os.path.expanduser(plist)) 32 33 plist = NSMutableDictionary.dictionary() 34 35 plist.setObject_forKey(mylabel, "Label") 36 plist.setObject_forKey(NSNumber.numberWithBool(YES), "RunAtLoad") 37 plist.setObject_forKey(executablePath "Program") 38 I need to pass in some ProgramArguments... Would I do it by: plist.setObject_forKey([arg1, arg2, arg3], "ProgramArguments") Thanks, -Roy Nielsen ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk _______________________________________________ Pyobjc-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyobjc-dev