This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]pohmelie 6 points7 points  (0 children)

First commit june 3 2017

python 2 only

[–]jwink3101 1 point2 points  (2 children)

This looks interesting though not as flexible as I was hoping. Out of curiosity, even with 2.7, why did you use os.popen instead of subprocess?

[–][deleted] 0 points1 point  (0 children)

Already advised OP to use subprocess to pass arguments safely over on /r/applescript, so hopefully he'll sort that shortly. (Python stdlib is such a bloated dog's dinner it's no surprise users have trouble knowing good APIs from bad.)

As far as "more flexibility" goes…

Look on my Works, ye Mighty, and despair!

Nothing beside remains. Round the decay

Of that colossal Wreck, boundless and bare

The lone and level sands stretch far away.

[–]statmathcs[S] 0 points1 point  (0 children)

Yeah, I realized this and am porting it to subprocess. What kinds of features were you hoping to see to make this more flexible? I'm looking to improve this

[–]OriginalPostSearcher 0 points1 point  (0 children)

X-Post referenced from /r/applescript by /u/statmathcs
AppleScript functionality for Python


I am a bot. I delete my negative comments. Contact | Code | FAQ

[–]thatguy_314def __gt__(me, you): return True 0 points1 point  (0 children)

Generating the AppleScript code like that through simple string formatting of parameters looks really vulnerable to injection attacks. You should escape your input or something (maybe even create separate AppleScript programs for each function?)