• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Help needed understanding a script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
+--------------------------------------------------------------------------+


  • Prev by Date: Graphical text via CGI
  • Next by Date: Re: Help needed understanding a script
  • Previous by thread: Re: Graphical text via CGI
  • Next by thread: Re: Help needed understanding a script
  • Index(es):
    • Date
    • Thread