On May 08, 2011, at 05:19, Mike wrote:
> Yes, I should have been more clear. I already figured out the Finder stuff.
______________________________________________________________________

Hey Mike,

My script included more than the Finder stuff, however upon re-inspection it 
*doesn't* open a disk browser as I had thought.

This is a better script:

try
  tell application "Finder"
    if front window exists then
      set winTarget to (target of front window) as alias
    else
      set winTarget to (path to desktop folder)
    end if
    set sel to selection as alias list
  end tell
  tell application "BBEdit"
    if sel ≠ {} then
      open sel
    else
      open winTarget
    end if
  end tell
on error errMsg number errNum
  set sep to "=============================="
  set e to sep & return & "Error: " & errMsg & return & sep & return ¬
    & "Error Number: " & errNum & return & sep
  beep
  display dialog e
end try

It *still* opens a project browser though if the target is a folder.

As far as I can see there is no means at this time to script a disk browser 
window's target, and I have a note into Bare Bones Support about the issue.

How are you running your script?  From the BBEdit script menu or from elsewhere?

--
Best Regards,
Chris

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to