On Sep 23, 2015, at 15:15, Christopher Stone <[email protected]> wrote:
> This can be done with AppleScript with a couple of limitations.
> 
> All documents must have been saved.

______________________________________________________________________

Hey Folks,

With Patrick's help I was able to make this work on projects that contain 
unsaved documents.

I haven't tested it extensively, so if you find any issues let me know.

--
Best Regards,
Chris

-------------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2015/09/22 15:33
# dMod: 2015/09/30 00:18
# Appl: BBEdit
# Task: Go to last modified document in a project window (excluding front 
document).
# Tags: @Applescript, @Script, @BBEdit, @Go-To, @Last, @Modified, @Document.
-------------------------------------------------------------------------------------------

tell application "BBEdit"
  set bbeditApp to it
  
  tell front project window
    set docList to (documents where its name is not ¬
      (get name of active document) and its name does not contain ".bbprojectd")
    
    if docList ≠ {} then
      set {docNameList, docModDateList} to {name, modification date} of ¬
        (documents where its name is not (get name of active document) and its 
name does not contain ".bbprojectd")
      
      repeat with i from 1 to (length of docModDateList) - 1
        if (item i of docModDateList) < (item (i + 1) of docModDateList) then
          set item i of docModDateList to 0
          set item i of docNameList to 0
        end if
      end repeat
      
      set lastDocName to first item of (text of docNameList)
      
      select document lastDocName
      
    else
      beep
    end if
    
  end tell
end tell

-------------------------------------------------------------------------------------------


-- 
This is the BBEdit Talk public discussion group. 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 Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].

Reply via email to