Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BBEdit question...




On 29 Oct 2006, at 16:21, David Crowe wrote:

Does anybody know how to make a BBEdit document become the frontmost/selected document in its window?

The following code brings a specific window to the front, but this window may have multiple documents and the last line does nothing (not even generate an error).

set DocumentTitle to "Presentation " & SlideID
tell application "BBEdit"
try
set theCurrentDocument to first document whose name = DocumentTitle
on error -- No document with this title exists
try
set theCurrentDocument to make new document with properties {text:EntryText, name:DocumentTitle}
on error errmsg number errnum
display dialog "Error creating new BBEdit window" & return & errmsg
return
end try
end try


        tell window of theCurrentDocument to activate
   tell theCurrentDocument to activate -- does nothing
end tell


I believe the target of an activate command is either the application or a window, David.

Try replacing the last line in the tell block with:

------
select theCurrentDocument
------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >BBEdit question... (From: David Crowe <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.