Hey guys, this is my first attempt at scripting SD6, and I need a little help please.
###I’m writing a script to toggle between two Tabs as being frontmost.
I can see how to get a list of documents, but not Tabs. Are they the same thing?
Even with a document reference, I don’t see how to make it frontmost.
From the SD6 SDef:
A script window can contain multiple documents (scripts) as tabs. Script window properties that are really document properties apply to the current document (the frontmost tab).
current document get document The script document being displayed in this window (in the frontmost tab, if the window has multiple documents).
The “current document” is a “get only” property. How do I set it?
So the text refers to “tab”, but I don’t see a “tab” element anywhere.
TIA for your help.
P.S. Is there a library or collection of scripts somewhere that provide examples of how to script SD6?
I think this is an oversight on our part. The intent was for you to be able to set the script window's current document property to switch tabs. I also suspect I meant to support selecting documents within a script window, but that does not work either.
I’ve filed a bug at my end and I’ll try and get this resolved for 6.0.5.
tell application "Script Debugger"
tell script window 1
repeat 10 times
set current document to some item of (get documents)
end repeat
end tell
end tell
I’m writing a script/macro that will toggle between the last two documents (tabs?) that the user has viewed. So I need to store a reference to each document outside of a running script. Any ideas on the best method to do that?
It depends how persistent this needs to be. If a per-Script Debugger launch persistence is sufficient, then you can use document ID. If you need something more, then I would use document path.
It should be simple. Get the document’s id from the id property. You can then reaquire the document using an ID object specifier:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set theDocID to id of some document
tell document id theDocID
name
end tell