Scripting Bridge and Finder selection
Scripting Bridge and Finder selection
- Subject: Scripting Bridge and Finder selection
- From: Jjgod Jiang <email@hidden>
- Date: Wed, 2 Jan 2008 07:05:07 +0800 (CST)
Hi,
How do I get the currently selected file in Finder via Scripting Bridge
in Python? In Applescript, we have code like this:
tell application "Finder"
if selection is {} then
set finderSelection to folder of the front window as string
else
set finderSelection to selection as alias list
end if
end tell
but in Python, I tried
from ScriptingBridge import *
finder =
SBApplication.applicationWithBundleIdentifier_("com.apple.Finder")
selection = finder.selection()
however, selection is just a SBObject, which I couldn't get it's
real path, so how do I get it?
- Jiang
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden