user3058624
user3058624

Reputation:

Applescript how to display a dialog with text and a variable

I need to display a applescript dialog with text and a number by which i mean the text that it displays would be text and a varible like this display dialog "Enter spelling" and repeatnum buttons{"done"} This is the code I have`isplay dialog "How many spellings are there" buttons {"That amount"} default answer ""

set amount to text returned of result

set repeatdone to 0

repeat amount times

    repeatdone = repeatdone + 1

    display dialog "enter spelling " and repeatdone buttons {"Ok"} default answer ""

end repeat

When I try this it gives me the error cannot make enter spelling into type boolean, Is there anyway to make a applescript dialog display text and a varible

Upvotes: 1

Views: 12351

Answers (1)

adayzdone
adayzdone

Reputation: 11238

Try:

display dialog "How many spellings are there" buttons {"That amount"} default answer ""
set amount to text returned of result

set repeatdone to 0
repeat amount times
    set repeatdone to repeatdone + 1
    display dialog "enter spelling " & repeatdone buttons {"Ok"} default answer ""
end repeat

Upvotes: 4

Related Questions