Help needed understanding a script
Help needed understanding a script
- Subject: Help needed understanding a script
- From: David-Artur Daix <email@hidden>
- Date: Sun, 04 Mar 2001 17:26:21 +0100
I've downloaded several scripts from the Apple web site in order to
understand a bit better how AS works. In particular, I wanted to create a
script that would let me open the current Finder selection using an
application of my choosing. I've found a useful example, "Open Selected
Scripts", which I've been able to edit to do what I want. The result, using
BBEdit as the target app, is so:
tell application "Finder"
set the selected_items_list to every item of the selection
if the selected_items_list is {} then
beep
display dialog "No files are selected." buttons {"Cancel"} default button 1
end if
set the selected_items to {}
repeat with this_item in the selected_items_list
set the end of the selected_items to the contents of this_item as alias
end repeat
end tell
ignoring application responses
tell application "BBEdit 6.0"
activate
open the selected_items
end tell
end ignoring
The problem is that the original script doesn't contain any comments to
explain what the script is doing. And there are a few lines which I don't
really understand. I hope someone can enlighten me.
What exactly is the meaning of this command:
"set the end of the selected_items to the contents of this_item as alias"
I believe it stores the pathnames for the selected items in the
selected_items variable, but the syntax and its meaning eludes me.
Also, what does the "ignoring application responses" step do?
Thanks in advance.
+--------------------------------------------------------------------------+
"I didn't really want to boot this machine up in Linux. If you let your
computers know about alternative operating systems they may never be happy
with Windows." -- Jerry Pournelle, ~in~ BYTE Online, May 24th, 1999
+--------------------------------------------------------------------------+