Tell application system events keycode etc... If there is a menu option

Sent from my iPhone

On May 8, 2011, at 6:19 AM, Mike <[email protected]> wrote:

> Thanks Chris.
> Yes, I should have been more clear. I already figured out the Finder
> stuff.
> The code I stealed from the net is below.
> 
> The problem is that the open command always opens a project browser
> not a disk browser.
> (Sometimes I'd like a project browser, sometimes a disk browser,
> probably just a neurosis of mine...)
> 
> I wondered if there's another Applescript verb or an option to open
> that gives back a disk browser?
> 
> Here's the code:
> 
> on run
>    tell application "Finder"
>        set _list to {}
>        set _items to selection
>        if _items is {} then
>            set _folder to folder of the front window as string
>            copy _folder to end of _list
>        else
>            repeat with _item in _items
>                set _item to _item as alias
>                copy _item to end of _list
>            end repeat
>        end if
>    end tell
>    bb(_list)
> end run
> 
> on open (_list)
>    bb(_list)
> end open
> 
> 
> on bb(_list)
>    tell application "BBEdit"
>        open _list
>        activate
>    end tell
> end bb
> 
> 
> On 6 Mai, 14:41, Christopher Stone <[email protected]>
> wrote:
>> On May 06, 2011, at 04:59, Mike wrote:> I'd like to make an Applescript that 
>> opens the currently selected folder in a disk browser.
>> 
>> ______________________________________________________________________
>> 
>> Hey Mike,
>> 
>> When asking for scripting help it's desirable to describe the process 
>> completely enough that people don't have to guess at your intent.  It's all 
>> too easy to skip salient details, because *you* already know what you want 
>> to do.
>> 
>> In this instance you don't say where the currently selected folder is.  In 
>> the Finder?
>> 
>> If so then this might work for you:
>> 
>> tell application "Finder"
>>   try
>>     set fldr to selection as alias
>>     if class of (get properties of fldr) is folder then
>>       tell application "BBEdit"
>>         activate
>>         open fldr
>>       end tell
>>     else
>>       beep
>>     end if
>>   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
>> end tell
>> 
>> You can also change the size and position of the disk browser if desired.
>> 
>> --
>> 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>

-- 
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