|
|
#1 |
|
Prospect
Join Date: Feb 2003
Posts: 31
|
Text Edit RTF Drag & Drop Question
Is there a modifier key that will allow me to drop a file into an RTF document open in text edit that will paste the file path instead of the file itself? I find it rather annoying that I must open an interim file that is plain text to drop a file there, copy its path, then paste it into the RTF document. I've tried every modifier key combo I can think of and cannot control the behavior of drag & drop into an RTF document.
Or perhaps someone knows of a service that will allow me to control-click on a file and select a menu item to copy its path...? BTW, I'm running Lion, so I don't know if this is an issue that is solved in Mountain Lion. Thanks, Rob |
|
|
|
|
|
#2 | |||||||||||||||||||||||
|
Hall of Famer
Join Date: Dec 2007
Posts: 3,649
|
Calling it an issue implies something not behaving correctly. In this case, everything is working properly since RTFs have the ability to accept attachments. Anyway, a script like the ones below will probably help. You could save either as an application for easy Dock access or you could use Automator to create a Service (and then, optionally, System Preferences > Keyboard to assign a keyboard shortcut). Code:
tell application "Finder"
activate
set thisFile to selection as alias
set theChoice to button returned of (display dialog "Get Alias Path or Posix Path for " & return & return & ((name of thisFile) as text) & "?" buttons {"Cancel", "Alias", "Posix"} default button 3)
if theChoice = "Posix" then
set the clipboard to (POSIX path of thisFile) as text
else
set the clipboard to "alias \"" & (thisFile as text) & "\"" as text
end if
end tell
Code:
tell application "Finder" try if exists front window then my copy_path((first item of (get selection as list)) as alias) end if end try end tell on open these_items my copy_path((first item of these_items) as alias) end open on copy_path(strPath) try set strPath to the POSIX path of strPath end try end copy_path |
|||||||||||||||||||||||
|
|
|
|
|
#3 |
|
League Commissioner
Join Date: Jan 2002
Posts: 7,998
|
You could use TexEdit/Edit menu/Add Link...
Drag your file into the box, and click OK. That will paste the file's path into your document. You can also use the shortcut "command-K" to open that Link Destination window directly. |
|
|
|
|
|
#4 | |||||||||||||||||||||||
|
Prospect
Join Date: Feb 2003
Posts: 31
|
You're right of course. Thanks for the script. Rob |
|||||||||||||||||||||||
|
|
|
![]() |
| Tags |
| drag and drop, file path, lion, rtf, text edit |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|