• 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
Re: Dialog simple question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dialog simple question


  • Subject: Re: Dialog simple question
  • From: "Mark J. Reed" <email@hidden>
  • Date: Wed, 19 Oct 2005 16:14:29 -0400

On 10/19/05, Bernard AZANCOT <email@hidden> wrote:
         Just another newbie question.

If I write :

set itemcount to count every item of folder theFolder_dok
set Dialog1 to "File(s) copied : " & itemcount 

Everything is OK.

Now, if I write :
 set itemcount to count every item of folder theFolder_dok
 set Dialog1 to itemcount  & " file(s) copied."
 
I get no dialog.


I assume that in order to get your dialog you are doing something like "display dialog Dialog1" later?  Otherwise you'll get no dialog in either case . .

Regardless, the reason (itemcount & "blah") is different from ("blah" & itemcount) is that the meaning of & depends on the type of its left-hand argument.  If that is a string, then it does a string append; otherwise, it does a list append, creating a new list as needed.  Since itemcount is a number, not a string, the result of (itemcount & " file(s) copied.") is a list: {itemcount, " file(s) copied."}. 

What you are looking for is this:

set Dialog1 to (itemcount as string) & " file(s) copied."

--
Mark J. Reed <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Dialog simple question
      • From: Dave Balderstone <email@hidden>
References: 
 >Dialog simple question (From: Bernard AZANCOT <email@hidden>)

  • Prev by Date: Re: Getting a handler to use a value from a different handler?
  • Next by Date: Re: Dialog simple question
  • Previous by thread: Dialog simple question
  • Next by thread: Re: Dialog simple question
  • Index(es):
    • Date
    • Thread