AppleScript to copy the path of file/folder present in first pane

19 views
Skip to first unread message

Chris Cairns

unread,
Jul 5, 2009, 7:57:17 AM7/5/09
to Blacktree: Quicksilver
This is a simple script to copy the path of file/folder as required
while writing applescript

Assign a unique first alphabet to the name of the script so that you
can use it by a shortcut like "Cmd+Shift+<unique first alphabet>".
Place it in ~/Library/Applications Support/Quicksilver/Actions folder
and restart Quicksilver.

Script to copy path (in colon separated form and as required while
writing applescripts) of file/folder to the clipboard :

using terms from application "Quicksilver"
on open theseitems
set thepath to path to users folder as string
set AppleScript's text item delimiters to ":"
set thepath to first text item of thepath
repeat with aitem in theseitems
tell application "Finder"
set r to POSIX path of (aitem as text)
set AppleScript's text item delimiters to "/"

set z to the text items of r
set AppleScript's text item delimiters to ":"
set z1 to text items of z as string

if second text item of z1 is "Volumes" then
set z2 to "\"" & text 10 thru -1 of z1 & "\""
set the clipboard to z2
else

set the clipboard to "\"" & thepath & ":" & (text 2 thru -1 of
z1) & "\""
end if
end tell
end repeat
end open
end using terms from

Or download it from here:
http://files.getdropbox.com/u/872430/get%20path_quicksilver.scpt
Reply all
Reply to author
Forward
0 new messages