ASSudio help 1 bug

all i have is 1 butten and id like to run this script but i get Command /usr/bin/osacompile failed with exit code 1

on clicked theObject
	(set dialogResult to display dialog ¬
	"What is your name?" buttons {"Cancel", "OK"} ¬
	default button "OK" cancel button ¬
	"Cancel" giving up after 60 ¬
	default answer " "
if button returned of dialogResult is "OK" then
	say "hi"
	say text returned of dialogResult
end if)
end clicked

Hi,

remove the parentheses. Parentheses cannot be used for multiple lines

thanks but that did not change a thing same error “Command /usr/bin/osacompile failed with exit code 1”

A display dialog doesn’t have a property cancel button. You have defined with buttons {“OK”, “Cancel”} already your cancel button. When pressing cancel, the text returned of result of dialog will be “Cancel”. Here you should do something like:

on clicked theObject
if theName of theObject is equal to "myButton" then
doMyAction()
end
end clicked

on doMyAction()
set theResult to display dialog "something to display" buttons {"OK", "Cancel"} default button "OK" default answer "" giving up after 60
if gave up of  theResult then
--dialog ended itself
return
end

if button returned of theResult is "Cancel" then
user pressed cancel
return
end

set theText to text returned of theResult
--continue code here
end doMyAction
--code is written as plain text so you could have some syntax problems

ok thanks thats good=]

no id like to use a textfield and a button and the script to say hi and whats in the text field but i dont know how to set {whats in the text field} to yourname.

iv got this so far but thats not right

set contents of text field "name" to yourname

on clicked theObject
	say "hi" & yourname
end clicked

It’s a long time ago I programmed in AppleScript Studio, but what about text field “name” of window 1?

that works fine
the final script is

on clicked theObject
	say "hi " & contents of text field "name" of window 1 as text
end clicked

thats my 1st apple scrip studio app made
thanks for all your help

Still a little comment :slight_smile:

First of all if you want ASS you should give the window a name as well. It’s not very common to use window 1 but more like window “nameOfWindow”. This is just a minor thing I want to say.

Then I want to let you know, if your already didn’t, that ASS comes to an end. It is not sure when it will be gone but Apple noticed with the release of snow leopard that ASS is deprecated and Applescript Studio users should make new projects with applescriptObjC. That’s also why the possibility to make ASS applications in the latest xcode versions is hidden.

And last congrats with your first ASS Application :slight_smile:

thanks for the congrats

i know that it has bin removed but i found a download that brings it back to xcode 3.2.5 so i am use in that.

id love to script in applescriptObjC but i am only 16 and find it to complex. i am studying scripting at the start of the school year but i just could no w8 to try out xcode.

Well I have to agree with you that it is complex and I’m not saying that you do anything wrong. I because you said you’re new to this I would just warn you about some things.

You could try to learn yourself a programming style so it’s easier to step over to applescriptObjC when the time comes.

thank you for the tip
i wish to study computers and have it as a career in the future so the tim will come one day