import os;

def callAS(cmd):

def selectFile():
	 callAS("""osascript -e 'tell application "Finder" to return choose file "Select the file:"'""")

def fixPath(raw):
	arr = raw.split(' ');

thePath = selectFile()
thePath = fixPath(thePath);

When the above code is run in IDLE, it just gives an error. But, when the above code is run in BBedit, it returns an error (saying that I can't split an object of null type), but also outputs alias ... How do I get the output from an AS function run from within Python?

Recommended Answers

Perhaps use this snippet instead of os.system()

Jump to Post

All 2 Replies

yup, thanks a lot!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.