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.
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.
Here is a very time-consuming, but effective method to link to a folder from a Textedit document.
Add a file to folder (e.g., an image file), select the file;
Context menu 'Open with...' and select browser (Safari);
Edit browser address bar path to delete filename, leaving path to folder, and copy this address to clipboard;
In Textedit document, enter some text to link to folder (e.g., folder name);
Select text, press Command-K and paste folder path, save.
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
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.
Right click and select "get info" on the file you want to link to in the text document. (You can also select the file and hit "Command + i" to bring up the info dialog box)
Right click the file path in the "Where" field under the "General Section" and select copy
Go to the TextEdit document that you want to create the link in
Select the text you want to use as a link
Select text, press Command-K and paste folder path, but don't hit save yet.
Add the text "file:" without the quotes to the beginning of the link
Add a "/" character (not including the quotes) and the filename and the extension to the end of the link.
Now hit ok or save
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
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.
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.
Related
I'm trying to inspect the code in a module found in a subfolder of /usr/local/lib/python3.9/site-packages/*.
The trouble is that Visual Studio Code only gives me the system finder view, to navigate to the folder, and I'm not quite sure how to get to the root to even find /usr.
typing the path in the search bar doesn't help
navigating to Macintosh HD and or Volumes still doesn't show me /usr or other common Linux folders located on the root filesystem.
This method should work in any app that uses the standard file dialogs:
In the Finder open a new window
Type Command-Shift-G or select Go to Folder… from the Finder’s Go menu
Enter your path, e.g. /usr/local/lib/python3.9/site-packages
You now have a Finder window showing the (parent) folder of where you want to explore
In VSCode type Command+O or select Open… from the File menu
A standard file dialog will open
Click on a folder icon in your Finder window, this can be an icon in the window itself or the one in the window’s title bar, and drag and drop it onto the standard file dialog.
The dialog will switch to show the dropped folder
Continue navigating as usual
I opened up a large project in Atom. I'd like to travel to a file that is four folders deep into the project. Normally, I will go into the sidebar and flip open folders. Is there a way to open files programmatically? I'm thinking about the ability to use cd in terminal.
If you're trying to open a deeply nested file, try using the Fuzzy File Finder (Cmd-T on a Mac, Ctrl-T on Windows) to type in the name of the file. If you want to see it in the tree view after opening it, use the Reveal in Tree View feature (right click on the file tab and click Reveal in Tree View, or press Cmd-I with the file open).
I want to change the folder icon in C drive. When I go onto the tab "Customize" in folder Properties, choose an icon and then apply, nothing happens.
You can use FileTypesMan,a nirsoft tool that allows you to do a lot of things.
Dowload FileTypesMan and open it.
Locate your type of file (like image, or folder for exemple)
Click on it and select "Edit Selected File Type"
Change defaut icon and confirm
An example for png file :
Example to change png type files
How can I open the containing folder of an open file in Sublime Text 3 in OSX? Prefer an answer that shows me where the menu option is, rather than setting up a command-line.
Some other posts I've searched suggest right-clicking the file and selecting the Open Containing Folder option, but I don't see it on mine...
What you read is correct, but you may be falling afoul of the fact that the context menu that you get when you right click on the file tab is different than the one that you get if you right click in the file itself and, counter-intuitively, the option for opening the containing folder (or copying the path of the file to the clipboard) only appears in the file context menu.
The option you want is Reveal in Finder, which is near the bottom of the menu (note that my menu may be slightly different than yours depending on installed packages):
I'm using Perforce for managing our code base. In Perforce, we need to check out a file before we can edit it. When I'm working in Xcode, sometimes I want to know the full path to the working file so that I can check it out in Perforce.
So here is my question:
Is there a shortcut, plugin or some other quick way to copy the full path of a file in Xcode?
What I have known:
I can Command+click on the file tile to show up the full path, but I cannot copy it.
In Visual Studio, we can right click on the file's tab and choose Copy Full Path to achieve this.
In Eclipse, we can Alt/Option + Enter to achieve this.
Update:
Actually my question is about how to achieve the equivalent Copy Full Path feature inside Xcode. Anyway, dragging the file to the terminal is also a very nice workaround.
You can copy it directly out of the File Inspector. The first section ("Identity and Type") of the File Inspector shows information about the selected file, or the file that contains the selected symbol, etc. You have Name, Type, Location, and Full Path. You can select the full path and copy it.
As a shortcut, a triple click on any part of the path will select the entire path. There's also a small icon with a light arrow on a dark background -- clicking that will open a Finder window with the file selected.
You can drag it to a terminal... Easy and fast...
on your editor XCode (you want to get the file path). Press:
Command+Shift+J
xcode will open directory file path on Project Navigator (left side bar)
and then drag-and-drop file from Project Navigator to the terminal. it will give you the directory of the file.
You can use find command to copy file path:
cd myProject
find . -name myCodeFile.cpp
Extending Caleb's answer, here is a graphical demo:
Steps:
Select a filename on the Project navigator from the left side Navigator panel.
Tap on Show File Inspector from the right side Inspectors panel. (marked with red box)
Copy the path from there. (marked with a bigger red box)