• 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
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dialog


  • Subject: Re: Dialog
  • From: "email@hidden" <email@hidden>
  • Date: Wed, 25 Nov 2009 08:57:14 -0800

This works for me...

tell application "Finder"
	set itemcount1 to count every item of folder X
	set itemcount2 to count every item of folder Y
	set itemcount3 to count every item of folder Z

	set Dialog1 to (itemcount1 as text) & "blah... blah..." & return
	set Dialog2 to (itemcount2 as text) & "blah... blah..." & return
	set Dialog3 to (itemcount3 as text) & "/" & itemcount1 + itemcount2 & "blah... blah..." & return
	set Dialog4 to "blah... blah..."
end tell
display dialog Dialog1 & Dialog2 & Dialog3 & Dialog4 buttons {"Cancel", "OK"} default button "OK"

-----------------

What's happening is that AppleScript is combining your items as a list because the first item is not text.  You said you tried "as text" but without seeing how, I can't say why that didn't work.

Another option might be:
set appleScript's text item delimiters to ""
set Dialog1 to (itemcount1 as text & "blah... blah..." & return) as text

or
set appleScript's text item delimiters to ""
set Dialog1 to {itemcount1 as text) , "blah... blah..." , return} as text



HTH,

ES

On Nov 24, 2009, at 11:30pm, ba95 wrote:

> Simple but irritating newbie problem.
>
> If I write :
> --
> set itemcount1 to count every item of folder X
> set itemcount2 to count every item of folder Y
> set itemcount3 to count every item of folder Z
>
> set Dialog1 to temcount1 & "blah... blah..." & return
> set Dialog2 to itemcount2 & "blah... blah..." & return
> set Dialog3 to itemcount3 & "/" & itemcount1 + itemcount2 & "blah... blah..." & return
> set Dialog4 to "blah... blah..."
>
> display dialog Dialog1 & Dialog2 & Dialog3 & Dialog4 buttons {"Cancel", "OK"} default button "OK"
> --
> The script does not run correctly.
> I have tried to add "as text" to the "itemcounts" unsuccessfully.
>
> If I write :
> --
> set itemcount1 to count every item of folder X
> set itemcount2 to count every item of folder Y
> set itemcount3 to count every item of folder Z
>
> set Dialog1 to "blah... blah..." & itemcount1 & return
> set Dialog2 to "blah... blah..." & itemcount2 & return
> set Dialog3 to "blah... blah..." & itemcount3 & "/" & itemcount1 + itemcount2 & return & return
> set Dialog4 to "blah... blah..."
>
> display dialog Dialog1 & Dialog2 & Dialog3 & Dialog4 buttons {"Cancel", "OK"} default button "OK"
> --
>
> There is no problem.
>
> Thanks to help me.
>
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Dialog
      • From: "email@hidden" <email@hidden>
References: 
 >Dialog (From: ba95 <email@hidden>)

  • Prev by Date: Re: New user/ first question since 3 months
  • Next by Date: Re: Dialog
  • Previous by thread: Re: Dialog
  • Next by thread: Re: Dialog
  • Index(es):
    • Date
    • Thread