Re: copy full filepath name
Re: copy full filepath name
- Subject: Re: copy full filepath name
- From: Christopher Stone <email@hidden>
- Date: Tue, 22 Jun 2004 07:18:11 -0500
Am 22.06.2004 um 11:58 schrieb Oz Springs:
For OS9 there were a couple of things I could use to copy the pathname
of a document on my Mac, for example Acme CMM Widgets for contextual
menus. Unfortunately this hasn't been upgraded for OSX.
______________________________________________________________________
AppleScript solution:
----------------------------------------------------------------------
-- Created : 2003/08/08 @ 10:31
-- Modified : 2004/06/22 @ 06:19
-- Author : Christopher Carsten Stone <email@hidden>
-- Description : Finder: get path of selection(s)
-- Dependencies : None
-->> ===={ Main }============================================
try
tell application "Finder"
set sel to selection
if (count of sel) = 1 then
set sel to ("alias \"" & item 1 of sel as string) & "\""
else if (count of sel) > 1 then
repeat with i from 1 to length of sel
set item i of sel to "alias " & (item i of sel)
end repeat
set AppleScript's text item delimiters to {return}
set sel to sel as string
else
-- Fail gracefully
return
end if
set the clipboard to sel
end tell
on error errMsg number errNum from errFrom partial result errResult to errTo
set msg to errMsg & return & return & "Number: " & errNum
beep
display dialog msg with icon 0 giving up after 60
end try
----------------------------------------------------------------------
I've got this attached to a QuicKeys shortcut in the Finder, so Control-P
copies the path(s) of the selected object(s) in the form of to the
clipboard:
alias "Lao-Tzu:Users:chris:Desktop:Source Folder:1.jpg"
It would be a doddle to rewrite this to get the Posix Path and attach
that to Control-Shift-P (or whatever).
With the Big Cat Contextual Menu plug-in you can attach AppleScripts to
the Contextual Menu as well.
Chris
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.