Reputation: 421
Is there a way to create a link to a folder in a Textedit document?
Textedit native interface clearly cannot link to a folder. Finder, drag folder or alias to textedit document, then directly or through system prompts an image icon is created in the Textedit document to represent the folder (or file), but no link is created.
Upvotes: 1
Views: 2316
Reputation: 1
Automator: workflow receives current 'files or folders' in 'Finder'. Utilities: 'Copy to Clipboard'. Then save service as: 'Copy Path'.
Finder: right click object (folder or file) and select service Copy Path.
TextEdit: edit link, type file: and paste path from clipboard.
Upvotes: 0
Reputation: 41
The Open
service should work for opening files and folders from paths in TextEdit and other text editors.
Two ways of getting a file or folder path into TextEdit:
For plain text documents: Simply drag'n'drop a file from Finder to your TextEdit document or
For RTF formatted documents: Select the file or folder in Finder, copy the file path (Command + Option + C
), select your document in TextEdit, paste the path to the document (Command + V
). That avoids the icon and pastes a text link to formatted and unformatted TextEdit documents.
The result will be something like this: /Path/To/File.ext
for files or /Path/To/Folder
for folders
To open a file or folder path from TextEdit with the Open
service
Select the whole path in TextEdit (e.g. by left-click + hold + move
or by moving the cursor with the help of the Arrow
keys to the beginning or the end of the path, then select the path by pressing Shift + Arrow left/right
keys, optionally in combination with Command
or Option
key)
Select the service Open
from the Service Menu (Contextual or TextEdit menu).
Confirm the dialog Confirm Service
: TextEdit wants to use the restricted Service “Open.”
by pressing Run Service
You might also want to setup a keyboard shortcut for utilizing the Service Open
(e.g. Command + Shift + O
). It can be done in > System Preferences > Keyboard > Shortcuts > Services > Text > Open. In the same Keyboard setting window tab, you can also activate All controls
for dialog boxes, so that you can confirm Run Service
by pressing Spacebar
to get keyboard control for the whole task.
Upvotes: 0
Reputation: 433
I came here looking for a way to open another TextEdit file using a hotlink. The previous ideas are definitely a step forward for me. While this is a slightly different question, my results may be useful here.
Using the file://
prefix on a full file path of the form:
file:///Users/myname/Documents/Personal/.../file.rtf
If the file is not already open, then the hotlink opens Finder and the file is highlighted.
If the file is already open, then the link takes me to the open file.
I have not found a way to get it to open a file that is not already open.
Results are a little differet when the link is to a folder instead of a file. Using the file://
prefix on a full folder path of the form:
file:///Users/myname/Documents/Personal/.../foldername/
Whether or not the named folder is already open, the hotlink opens Finder for the parent folder and the named folder is highlighted.
If the parent folder is already open, then the link goes to that open folder and highlights the named folder.
I have not found a way to get it to open the target folder, other than by naming a file that is in that folder. The special name ".
" does not work for that.
In Mojave 10.14.6, using hotlinks to other RTF files that open in TextEdit by default.
Upvotes: 2
Reputation: 1
I couldn't get Chrome nor Safari to allow me to select a file path. This is an updated version of Mark Stewart's response that worked for me.
I am sure someone could create a hot folder or right click menu that would build the path and precede it with file: and save it to the clipboard automatically.
macOS Catalina 10.15
Upvotes: 0
Reputation: 421
Here is a very time-consuming, but effective method to link to a folder from a Textedit document.
Now you have a Textedit link to the folder that will open in Finder! Maybe... using Automator and System Preferences Keyboard, this could be turned into a context menu command. Though I am noticing that in macOS Sierra 10.12.1 the use of customizations for context commands is flakey, TO PUT IT MILDLY... There has to be an easier way!
macOS Sierra version 10.12.1
Upvotes: 0