Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Paul Sanderson UK

macrumors newbie
Original poster
Feb 25, 2024
2
0
United Kingdom
In TextEdit (1.12, iMac 10.12.6, Sierra) I’d like to print the document path info when the document is printed. It is easy to print the headers and footers (checkbox in the printing box) but that only shows the document name and its date, plus the page number.


What I’d like to print is the path, which (with the document icon selected) you can see (1) at the bottom of the Finder window, or (2) in Finder >Get Info, then in the ‘Where:’ section of the window that comes up. You can copy-’n’-paste from Get Info into the actual document – and thus it’s visible in the document, so at least it’s there – but I’d like it to be invisible on-screen yet print visibly when the document is printed… just like headers and footers are.


Simply having “Print headers and footers” checked does not print the path. I suspect it is just not possible in TextEdit itself, though might be possible by putting a TextEdit document through some other software, which I would rather not do. If I understand it correctly, I can see that others seem to recommend Applescript: that’s a tecky step too far for me.
 

Paul Sanderson UK

macrumors newbie
Original poster
Feb 25, 2024
2
0
United Kingdom
Many thanks. While I don't want yet m-o-r-e software on my iMac – especially just for this, which really isn't important – I'll give LibreOffice a try, just to satisfy my curiosity and further my knowledge. The subsequent link to "Print filename or path with document" I'd already seen before posting my own query. It's instructions for printing the path refer to right-clicking on a file, but with my Apple mouse there is no right-clicking. But I'm guessing it takes you to Get Info, in which case we're back where we started (see my original query, above): the path is visible in 'Where:' but you have to copy-'n'-paste that into the body of the document – I can't see where you would paste it into the document's header or footer data, since the source of those is invisible.
 

bogdanw

macrumors 603
Mar 10, 2009
5,700
2,734
From Apple’s support page “Print headers and footers in TextEdit on Mac” https://support.apple.com/guide/textedit/txte44f15043/mac
I understand that “Headers and footers appear only on printed pages, not on the screen.”.
So... they are not editable in any way.
With AppleScript, you can easily copy the path of the current document in the clipboard and paste it at the beginning or the end of the document.
AppleScript that can be integrated into a QuickAction and given a shortcut:
AppleScript:
tell application "TextEdit" to set TheFilePath to path of front document
tell application "Finder" to set the clipboard to TheFilePath
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.