Applescript help required to fix "Move to" action

21 views
Skip to first unread message

Chris Cairns

unread,
Apr 26, 2009, 10:24:19 AM4/26/09
to blacktree-...@googlegroups.com
I want to create a "Move to" action which shall always do a "Move
to" (instead of a "Copy to" in case the destination volume is
different than source volume). This will be done by first copying and
then deleting the files.

I shall use only two panes because I don't know how applescript will
except an item from the third pane.
This is how I propose to do it:

1. I shall collect items a,b,c,d etc in pane 1 using comma trick. The
last item (say z) shall be the destination folder.

2. I shall run an applescript in the actions pane to work on these
items.
3. In the applescript, I want to be able to refer to the last item
(say z) so that i can use z as the destination folder.

Is there a way to refer to the last item among all the items in the
first pane?

Thanks in advance.

Jon Stovell (a.k.a. Sesquipedalian)

unread,
Apr 26, 2009, 11:01:10 AM4/26/09
to Blacktree: Quicksilver
on open the_items
set destination to posix path of last item of the_items
set files_to_move to items 1 thru -2 of the_items
repeat with this_file in files_to_move
do shell script "mv " & quoted form of posix path of this_file & space
& quoted form of destination
end repeat
end open

Chris Cairns

unread,
Apr 26, 2009, 11:22:01 AM4/26/09
to blacktree-...@googlegroups.com
Vow!!
Thanks a lot, Jon
If you can fix these important things in Quicksilver within couple of
minutes, I request you to add them somewhere in the forum (in the
files section or the applescript thread). They will be very useful to
us.
I mean, some other actions like "Compress Using...", "Create
Archive" (which do not work for multiples files in first pane)

Loriot

unread,
May 3, 2009, 8:13:51 PM5/3/09
to Blacktree: Quicksilver
I second that request.

Steve

unread,
May 7, 2009, 11:05:33 PM5/7/09
to Blacktree: Quicksilver
Can anyone help me with where to save this Applescript and how to
create it? I'm fairly new to OSX, but I've gotten the hang of it and
i'm a quick learner... just need some help to get my Move To working
(right now it just copies the selected files to my NAS, instead of
truly Moving them).

Thanks,

Steve

Steve

unread,
May 7, 2009, 11:21:16 PM5/7/09
to Blacktree: Quicksilver
Actually... cancel my request, i figured it out... just didn't realize
the comma trick was involved to choose the destination.

Thanks!

On May 3, 8:13 pm, Loriot <lor...@gmail.com> wrote:

DrFred

unread,
May 9, 2009, 11:36:27 AM5/9/09
to Blacktree: Quicksilver
I want to try this as having 'move' actually be 'copy' in QS has been
a minor irritation. I copied and pasted Mr. Stovell's script into
Script Editor and when I tried to save it, got an error message
regarding the ampersand (&) between '. . . this_file & space' AND
'quoted form . . .'; the message suggested 'end' in the place of '&'.
Anyone with script experience (myself not included, obviously) with a
suggestion? I'll review the procedures for triggering the script once
I get it right. Thanks, FW.

DrFred

unread,
May 9, 2009, 11:36:44 AM5/9/09
to Blacktree: Quicksilver
I want to try this as having 'move' actually be 'copy' in QS has been
a minor irritation. I copied and pasted Mr. Stovell's script into
Script Editor and when I tried to save it, got an error message
regarding the ampersand (&) between '. . . this_file & space' AND
'quoted form . . .'; the message suggested 'end' in the place of '&'.
Anyone with script experience (myself not included, obviously) with a
suggestion? I'll review the procedures for triggering the script once
I get it right. Thanks, FW.

On May 7, 8:21 pm, Steve <steve.led...@gmail.com> wrote:

Steve Ledlow

unread,
May 9, 2009, 1:17:59 PM5/9/09
to blacktree-...@googlegroups.com
I got the same thing, however, if you just bring the ampersand ( and
maybe the command that follows it) up a row, it works fine.

Jon Stovell (a.k.a. Sesquipedalian)

unread,
May 9, 2009, 1:42:38 PM5/9/09
to Blacktree: Quicksilver
The Google Groups software automatically inserts line breaks into any
long lines of text. The line "& quoted form of destination" is
actually supposed to be the end of the line that begins with "do shell
script". Remove the line break and recompile in Script Editor.

DrFred

unread,
May 10, 2009, 11:32:51 AM5/10/09
to Blacktree: Quicksilver
worked perfectly, compiled, ready to go––thank you.

On May 9, 10:42 am, "Jon Stovell (a.k.a. Sesquipedalian)"

DrFred

unread,
May 10, 2009, 11:33:06 AM5/10/09
to Blacktree: Quicksilver
worked perfectly, compiled, ready to go––thank you.

On May 9, 10:42 am, "Jon Stovell (a.k.a. Sesquipedalian)"
<jonstov...@gmail.com> wrote:

DrFred

unread,
May 11, 2009, 11:56:04 AM5/11/09
to Blacktree: Quicksilver
I apologize for this doubling of my posts; I don't know how it is
happening . . .
Reply all
Reply to author
Forward
0 new messages