Closed PostMonsterG closed 2 years ago
I think returning undefined is probably better than null, so please disregard that part of the idea.
This is a good idea. For some reason I thought we already had this functionality but I just scanned the list of verbs and couldn't find it. Obviously a verb that gets you info about the current file would be a good thing to have.
Also, I like the way you did the DocServer page for it as a way of specifying it. ;-)
Hot dog, that is perfect for my needs. Works great. Thank you!
I would find this very useful.
I thought about something like
tab.getFileInfo
, which would return the same type of structure asfile.getFileInfo
. However, I think that might be confusing. And, once you have the path from the tab, you can get the other info with the verb that's already there.I also considered a couple other options like
tab.getOutlineUrl
(returns the URL of the open tab, if it's not a Drummer file), andtab.getInfo
(returns some structure that combines both getFileInfo and URL-type stuff). I don't have a use right now for the first, and the second is basically a whole new API, so I discarded those as well.tab.getFilePath
Syntax
tab.getFilePath()
Params
None
What it does
If the outline in the current tab in the outliner is a Drummer file, returns the path to the file
Returns
The path to the file, or null if the outline in the current tab is not a Drummer file
Examples
tab.getFilePath ()
Notes
This verb returns null if the tab is not a Drummer file rather than undefined because the value is known to be null