Re: [Pythonmac-SIG] appscript: Newbie trying to script using System Ev ents

2011-02-05 Thread Charles Turner
On Feb 5, 2011, at 1:15 PM, dgo...@juno.com wrote: > Given your feedback below, is appscript+System Events a reasonable approach > for test automation? I'm sure there are many with greater experience, but I'd second everything has said about scripting system events: brittle and fiddly pretty we

Re: [Pythonmac-SIG] [ann] ASDictionary, ASTranslate updates

2010-12-22 Thread Charles Turner
OK, I got it: > import osax > > sa = osax.OSAX() > > print sa.do_shell_script("ls -l", administrator_privileges=True) If you look in the Applescript dictionary, it appears the function syntax is: > set theResult to do shell script unicode text ¬ > as type class ¬ > administrator priv

Re: [Pythonmac-SIG] [ann] ASDictionary, ASTranslate updates

2010-12-22 Thread Charles Turner
On Dec 22, 2010, at 2:12 AM, Adam Morris wrote: > How to translate this applescript into appscript?: > > do shell script "sudo rm /usr/bin/file" with administrator privileges > > Thanks for your software, has. I don't have the "with" solved, but it goes something like this: >> import osax >>

Re: [Pythonmac-SIG] Help with py-appscript?

2010-06-19 Thread Charles Turner
On Jun 19, 2010, at 7:44 AM, has wrote: > So I would suggest taking it up with the Skim authors, as it's probably a bug > in their scripting support. As a follow-up, Christiaan Hofmann offered this: On Jun 19, 2010, at 9:00 AM, Christiaan Hofman wrote: > This is a very old and very annoying Ap

Re: [Pythonmac-SIG] Help with py-appscript?

2010-06-19 Thread Charles Turner
On Jun 19, 2010, at 7:44 AM, has wrote: > So I would suggest taking it up with the Skim authors, as it's probably a bug > in their scripting support. Thanks for all the help, has. I've been talking with the Skimmers about this too. Best wishes, Charles

[Pythonmac-SIG] Help with py-appscript?

2010-06-17 Thread Charles Turner
Hi all- Although I'm sure I qualify as a Python noobie as well as with Applescript and Skim, I've run into the following and hope someone could shed some light for me. I have the following script: from appscript import * skim = app('Skim.app') reference = skim.documents[1].notes[1].selection.g

Re: [Pythonmac-SIG] OSX10.6/readline-6.1/python-2.6.5

2010-05-25 Thread Charles Turner
On May 25, 2010, at 10:25 AM, Chris Kees wrote: > I'm compiling python and readline from source and getting a segmentation > fault in readline This approach worked for me: I believe there's a test or two that fails,

Re: [Pythonmac-SIG] Help getting properties in py-appscript?

2010-04-14 Thread Charles Turner
On Apr 14, 2010, at 12:47 PM, has wrote: +1. It sounds like the OP's function is assigning values to 'k' at some point, e.g. 'for k, v in d.items():...', which is a general Python error, as you say. In which case, either pick a different variable name or use 'import appscript' and 'appscr

Re: [Pythonmac-SIG] Help getting properties in py-appscript?

2010-04-13 Thread Charles Turner
OK- Adding this at the script top-level enabled me to continue: r_uuid = k.uuid r_name = k.name r_type = k.type r_tags = k.tags r_plain_text = k.plain_text so my references to props[r_uuid] work inside a function definition. I'd still very much appreciate any elucidation of my problem, as I'm

[Pythonmac-SIG] Help getting properties in py-appscript?

2010-04-13 Thread Charles Turner
Hi all- Having some trouble getting my head around this, and wonder if someone could shed some light. I'm using py-appscript to get the properties of a record in DEVONthink Pro: from appscript import * dtpo = app('DEVONthink Pro.app') i = dtpo.selection.get() props = i[0].properties.get(

[Pythonmac-SIG] Issue with DEVONthink and ASDictionary

2010-02-27 Thread Charles Turner
Hi- Not sure if this is the best place to ask this question, but ASDictionary can't complete its production of a dictionary for DEVONthink Pro Office. See the screenshot here, as I couldn't copy the ASD log for some reason: Does anyone have an

Re: [Pythonmac-SIG] path, xcode, and python

2010-01-05 Thread Charles Turner
On Jan 5, 2010, at 8:07 AM, Ronald Oussoren wrote: There is a system installation of Python in /System/Library/ Frameworks, and you can add other Python installations yourself. The 2.6.4 installer at python.org installs 2.6.4 in /Library/ Framework. These different installations are comple