Re: [Pythonmac-SIG] New page on wiki about system Python

2014-08-02 Thread Adam Morris
Concur, seems like the best practice way to install python is with brew. Sent from my iPhone > On Aug 3, 2014, at 8:13 AM, Matthew Brett wrote: > > Hi, > > I just put up a new wiki page on why system Python can be incovenient to > use: > > https://github.com/MacPython/wiki/wiki/Which-Python >

Re: [Pythonmac-SIG] [Pyobjc-dev] Towards PyObjC 3.0

2014-06-03 Thread Adam Morris
I'm also very eager to hear an update, but PyObjC is going to be competing with Swift now! > On Jun 3, 2014, at 4:59 PM, Nicholas Cole wrote: > > Hi Roland, > > Could we all have an update on development plans? Do you think PyObjC > is going to work nicely with OS X 10.10? > > N. > > On Mon

Re: [Pythonmac-SIG] Query Regarding IDE for python for GUI Apps

2013-02-20 Thread Adam Morris
Let me add to the discussion Aquamacs. What I like about it most is that it supports all the usual Mac keyboard shortcuts but you can also hone all the power of emacs. It also has a command line open tool, full screen options, the kitchen sink. http://aquamacs.org -Adam _

Re: [Pythonmac-SIG] translate applescript to appscript

2011-08-12 Thread Adam Morris
>  app("Finder").items[mactypes.Alias("/path/to/file")] It works! Thanks!! (So simple, actually) ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/opt

Re: [Pythonmac-SIG] translate applescript to appscript

2011-08-11 Thread Adam Morris
s for POSIX file and alias?) I would be very grateful. Regards, -Adam On Thu, Jun 30, 2011 at 7:52 PM, Adam Morris wrote: > I have an AppleScript snippet that I need translating to python > appscript; too low-level for ASTranslate to handle: > > tell application "Finder"

Re: [Pythonmac-SIG] translate applescript to appscript

2011-06-30 Thread Adam Morris
> mactypes.Alias(unicodedata.normalize('NFD', os.path.abspath(path))) I want the result to respond to the Finder's dictionary, though, so wouldn't I need the Finder to wrap it rather than from the mactypes module? comment.get() on the resulting object doesn't work. ___

[Pythonmac-SIG] translate applescript to appscript

2011-06-30 Thread Adam Morris
I have an AppleScript snippet that I need translating to python appscript; too low-level for ASTranslate to handle: tell application "Finder" "/Users/brainysmurf/Desktop" as POSIX file as alias end tell I'm writing a wrapper class for the Finder and want to be able to pass /path/to/doc to

[Pythonmac-SIG] Porting xattr to Python3; question linking to dynamic library

2011-06-05 Thread Adam Morris
Not sure if this is the best place to ask, but you guys have been helpful in the past: Apple's python has the xattr module built-in, but I'm writing an app that needs ("wants") Python 3. I wrote to the author asking if there was any plans to port xattr to Python 3, and he suggested that it would b

[Pythonmac-SIG] improving interactivity in scripts

2011-05-04 Thread Adam Morris
Dear all, I was wondering what sort of options are out there for a poor soul who deploys Python extensively in his workflows, and uses appscript and calls to display dialog and the like to interact with the user, but would really, really like it if there could just be something out there, as easy

[Pythonmac-SIG] appscript 1.0 osax.OSAX() behavior

2011-05-04 Thread Adam Morris
Hello all, A while ago I wrote a Python class around appscript that would avoid (with calls to the shell osascript command) using the standard addition library's calls like display_dialog because it required the launch of Python Launcher, which slowed down the interaction with the user considerabl

Re: [Pythonmac-SIG] [py-appscript] is System Events sleeping ?

2011-01-30 Thread Adam Morris
Hi there, > I can force my system to sleep, but what I would like is to know when my > system is going to sleep, to launch some routines behind (like programming > an alarm to ring after 6 hours). I'm pretty sure not. Applescript doesn't let you register callbacks within the system, and even if

Re: [Pythonmac-SIG] Python development on OSX

2011-01-20 Thread Adam Morris
with my "installed" python 2.7 setup? (Installed isn't quite the right word, I know.) Why not? I guess it's because something is hard-coded somewhere ... I don't particularly "need" XCode but I really want to understand this. Can't tell you how muc

Re: [Pythonmac-SIG] Popen and py2app

2010-12-27 Thread Adam Morris
On Dec 28, 2010, at 12:24 PM, Aahz wrote: > Nope. If you're doing that, just use os.path.exists() or isfile(). > Faster and safer. I was hoping that I could detect it no matter where it was so advanced users could do symlinks or move it to their own folders or whatever which made me think of

Re: [Pythonmac-SIG] Popen and py2app

2010-12-27 Thread Adam Morris
On Dec 28, 2010, at 12:46 AM, Christopher Barker wrote: > I think you could specifically search for the utility in places it might be > expected to be found: > > /usr/bin > /usr/local/bin > /sw/... (for fink) > /opt/... (for macports) That's the first thing I tried; maybe I typed wrong? I'll gi

[Pythonmac-SIG] Popen and py2app

2010-12-27 Thread Adam Morris
py2app experts, I have a script that is packaged using and py2app that does a pre-check to see if a command line utility is installed, using Popen and "which name". (The script downloads and installs it if not.) I pass subprocess.PIPE for stdout and stderr, with shell=True. When I run the script

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

2010-12-22 Thread Adam Morris
> print sa.do_shell_script("ls -l", administrator_privileges=True) Thanks Charles, I had forgotten that do shell script is a part of the Standard Addition osax. Now I know how to run a script that needs the user's permission without having to use some GUI scripts to get the admin/password dialog.

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

2010-12-21 Thread Adam Morris
How to translate this applescript into appscript?: do shell script "sudo rm /usr/bin/file" with administrator privileges Thanks for your software, has. -Adam ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinf

[Pythonmac-SIG] pyobjc with appscript

2010-10-23 Thread Adam Morris
Dear Pythonmac-sig, I have a python script that gives Keynote some added features useful to teachers. It lets students interact with whatever is being projected right at their desk. It's written in python using appscript but at the moment runs entirely from the command line. I'm looking at giving

[Pythonmac-SIG] Keywords <=> Variables in appscript

2010-05-05 Thread Adam Morris
How can one refer to keywords (the k) given a variable? I'm working on a script that allows users to tell pages, for example, to set the current selection's properties to stroke type: solid, stroke width: 1.0. But I want to abstract all of this away. Coercion is simple enough, but what to do abou

Re: [Pythonmac-SIG] appscript fails to notice System Events is not running

2010-03-28 Thread Adam Morris
I use a function whose sole purpose is to return a reference to System Events to avoid this problem: import appscript as ap def getSystemEvents(): try: # ask System Events for processes to see if it's there throwaway = ap.app('/System Events').processes

[Pythonmac-SIG] getting a usable reference from app(url='.../System Events')

2010-03-02 Thread Adam Morris
Sorry for the resend but I'm not sure if my first attempt went through (new to gmail)! Hi all, I'm getting lots of milage out of appscript, but ran into a snag that searches haven't resolved. Trying to gui script a remote machine, and appscript doesn't seem to be working. This: app(url='e

[Pythonmac-SIG] usable references to a remote "System Events" application

2010-03-02 Thread Adam Morris
Hi all, I'm getting lots of milage out of appscript, but ran into a snag that searches haven't resolved. Trying to gui script a remote machine, and appscript doesn't seem to be working. This: app(url='eppc://machine.local/System Events').processes() complains that terminology can't be found and

Re: [Pythonmac-SIG] py2app annoyance

2010-01-22 Thread Adam Morris
> > http://wiki.python.org/moin/MacPython/BundleBuilder I've switched back to BundleBuilder, and it works fine. It takes a bit of trial and error to get everything wrapped up, but I've never understood why people bad-mouthed it so much. It's a single-script module, and reasonably easy to understa

Re: [Pythonmac-SIG] [Numpy-discussion] 1.4.0 installer fails on OSX 10.6.2

2010-01-06 Thread Adam Morris
> > However, there is a different type of Mac user -- the type that has > traditionally used Macs. Some of these folks are giving a bit of programming > a try, and have heard that python is an easy to learn language -- and, cool, > OS-X even comes with it installed! It's true there is definitely

Re: [Pythonmac-SIG] What to build binaries for???

2010-01-05 Thread Adam Morris
> -- it's just not universal enough. For now, I suspect these are the best > options: > > python 2.5: > python.org build (32 bit PPC and intel) > > python 2.6: > 32 bit python.org 2.6.4 > 64 bit python.org build? > > python 2.7: > python.org 3-way buil

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

2010-01-05 Thread Adam Morris
OK I've figured it out. After spending another morning doing a clean re-install (the do do do intro song is catchy the first time but lame after three... :) To get PyObjC working on Python 2.6.4: Install Python 2.6.4 Install setuptools for 2.6.4 Install PyObjC using setuptools This process was n

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

2010-01-05 Thread Adam Morris
ype "python" it "upgraded" to 2.6.4 for me. Off I go... (Maybe I should have just remained at 2.6.1 ) -brainysmurf On Tue, Jan 5, 2010 at 7:46 PM, Ronald Oussoren wrote: > > On 5 Jan, 2010, at 11:54, Adam Morris wrote: > > > Hi all, > > > >

[Pythonmac-SIG] path, xcode, and python

2010-01-05 Thread Adam Morris
Hi all, Just trying to get my system set up for some coding ... decided to reinstall everything (Snow Leopard) from scratch. What a mistake that was. I updated to 10.6.2, installed Xcode and THEN installed python 2.6.4. I think that might have something to do with two problems I'm seeing. The maj

[Pythonmac-SIG] Python 3 with Cocoa

2010-01-01 Thread Adam Morris
Dear all, I wrote to you the other week about the selection()() issue and got a really great reply. I never realized that the applescript munging going on would affect the way appscript works. Thanks for all the help, I've since got my classes working the way I want them to. I've recently tried i

Re: [Pythonmac-SIG] coercing to text (Adam Morris)

2009-12-15 Thread Adam Morris
ASTranslate tells me that tell application "Pages" to tell front document to get selection as text should be app(u'Pages').documents[1].selection.get(resulttype=k.unicode_text) but that doesn't return what I want (a reference? ... hardly useful!). Yet: app('Pages').documents[1].selection()() ret

Re: [Pythonmac-SIG] coercing to text

2009-12-14 Thread Adam Morris
In Applescript, I would write the following: tell app "Pages" to tell front document to get its selection -- text from character x to character y tell app "Pages" to tell front document to get its selection as text -- "whatever is selected" > Are you sure you are formulating the correct refere

[Pythonmac-SIG] coercing to text

2009-12-13 Thread Adam Morris
Hi all, Quick question from someone getting used to appscript with python. How do I coerce into a text? reference.get(resulttype=k.text) But that doesn't seem to do what I want it to do. In Applescript I actually get the string, but in appscript I still get a reference. Thanks for your help!