An "end tell" is only needed if you have more than one line of code that you
want to "tell" something. If this is the case, you would have to put the
"tell" on a line by itself:
tell app "Finder"
set nproc to names of processes
display dialog "These are the processes " & nproc
end tell
The only point of separate "tell" and "end tell" is to save yourself some
typing and is only needed if there is more than one line of code. By nesting
stuff within a "tell" statement by itself, it is like writing the "tell"
part of the statement onto every line before the next "end tell"
The following is interpreted EXACTLY as the above:
tell app "Finder" to set nproc to names of processes
tell app "Finder" to display dialog "These are the processes " & nproc
The way you had it (after removing the "end tell" - as seen below), the
finder sets the variable and the SCRIPT displays the dialog. Since you are
not giving what you are telling multiple commands, the "end tell" is not
necessary.
tell app "Finder" to set nproc to names of processes
display dialog "These are the processes " & nproc
Last but not least, the problem with your displaying of the variable "nproc"
is that it is a LIST and therefore will concatenate the values of the list
without spaces, giving you a result like:
"FinderControl Strip ExtensionInstand Palm DesktopTimbuktu Extension", etc.
I recommend you alter the AppleScript Text Delimiters before displaying the
dialog. As always, remember to revert them to blank when you are done. This
is as follows:
tell app "Finder"
set nproc to names of processes
set AppleScript's text item delimiters to return
display dialog "These are the processes " & nproc buttons "OK" default
button 1 -- (all on one line of code)
set AppleScript's text item delimiters to ""
end tell
The reason I appended the button name and default button is to avoid the
showing of a cancel button which will immediately stop execution of your
script and not return the Text Item Delimiters to their default.
Cheers,
Jay
on 8/17/00 12:42 PM, Sandy Papp at [EMAIL PROTECTED] wrote:
> OK, but actually I also tried it with this:
> tell app "Finder" to set nproc to names of processes
> display dialog "These are the processes " & nproc
> end tell
>
> It complained about the end tell statement and worked only without it.
----------
Duo/2400 List, The friendliest place on the Net!
A listserv for users and fans of Mac subportables.
FAQ at <http://www.themacintoshguy.com/lists/DuoListFAQ.shtml>
Be sure to visit Mac2400! <http://www.sineware.com/mac2400>
To unsubscribe, E-mail to: <[EMAIL PROTECTED]>
To switch to the DIGEST mode, E-mail to <[EMAIL PROTECTED]>
Need help from a real person? Try. <[EMAIL PROTECTED]>
----------
Dr. Bott | Great Duo & 2400 stuff including 10/100 Ethernet for 2400s!
Dr. Bott | Duo Batts too <http://www.drbott.com/prod/alist/duo.html>
NineWire | If they are cool enough to host this list...
Digital Solutions | ...you should check them out! http://www.NineWire.com/
PowerBook Guy is | Click here!
Everything PowerBook! | http://www.powerbookguy.com
Midwest Mac Parts ][ <http://www.midwestmac.com>
After-market parts for Macs. ][ 888-356-1104 ][
MacResQ Specials: LaCie SCSI CDR From $99! PowerBook 3400/200 Only $879!
Norton AntiVirus 6 Only $19! We Stock PARTS! <http://www.macresq.com>