mac os x で filemanager Path Finder を使用して、選択したファイル/フォルダーをpy-appscriptを使用して python で取得したい。py-appscript は、Python からスクリプト可能な Mac OS X アプリケーションを制御できる高レベルのイベント ブリッジです。
Applescriptでは、次のようになります
tell application "Path Finder"
set selection_list to selection -- list of fsItems (fsFiles and fsFolders)
set _path to posix path of first item of selection_list
do shell script "python " & quoted form of _path
end tell
Pythonでは、代わりに次のようなものになります
from appscript import *
selectection_list = app('Path Finder').selection.get() # returns reference, not string
では、selection_list の参照を python-strings に変換するにはどうすればよいですか?