Re: Dialog
Re: Dialog
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
References: | |
| >Dialog (From: ba95 <email@hidden>) |