Find path of current tbx file - howto?


(Erwin Panen) #1

Hi,

I’m running in kind of an idiotic issue:
How can I determine the path of the currently open TBX file?
What $Attribute is revealing this?
How can I put this to use in a Stamp or Agent?

Background info:

  • recently I’m experiencing issues with my macs, for now nothing specific to TBX, but this lead to doing a small investigation on my systems and network situation
  • I did some testing on my home network to discover if synology and zfs filesystems properly support OpenMeta tags.
  • In TBX I had a text window open from a map containing a screenshot. However I could not pinpoint where the Note was living > hence i set out to find out specifics of the note at hand in this ‘text window’
  • This lead me further to find the path of a currently open tbx map.

(Mark Anderson) #2

A TBX document works within Tinderbox and is not aware of its OS location per se. But in v6+ if you click on the file icon in the top-middle of the doc window you get standard Apple controls which can be expanded to show the document location.

For clarity, TB doesn’t have AppleScript support nor does the export/action code consider the app environment beyond doc scope/name. The TB pseudo-URL method also doesn’t reveal path as it works of the apps’s MRU list for doc paths.


(Paul Walters) #3

This script will give you the location of the document in Tinderbox that has the current focus.

tell application "System Events"
	tell its application process "Tinderbox"
		tell its window 1
			set theLocation to the value of attribute "AXDocument"
		end tell
	end tell
end tell

Note: if you have renamed “Tinderbox” to something else, like “Tinderbox 6”, then you need to change the value in the 2nd line of this. You could build an osascript to run this in terminal, and then use Tinderbox’s runCommand to create a stamp and put the value returned into an attribute. Sorry, no time to explain how to do that, or to answer further questions. Good luck :smile:


(Erwin Panen) #4

Mark,

Thanks, now I don’t need to ask how to do the copy item link anymore :wink:
Perfect for interlinking with e.g. DevonThink!
Thx!


(Erwin Panen) #5

Paul,

Thanks for hopping by!
I’ll check this one out. Had already taken a similar route to Mark’s > File > rename also opens a finder like window where I could see the location.

Very interested in the runCommand and your osascript idea!
Feel free if you ever have a little time to spare, in the meantime thanks a lot!

Erwin