Guys,
I have a piece of code I’m struggling with. I have an app where a dialog(1) pops up with three buttons: {Help, Add, Subtract} . When user taps the Help button, a second dialog should popup replacing dialog 1, displaying information about the app.This dialog will have a {Cancel,Continue} button. When user taps the Continue button, he should be returned to the previous dialog 1( The dialog with three buttons: {Help, Add, Subtract}).
The issue is that when I tap the ‘Help’ button, dialog2 doesn’t come into focus and the app icon keeps bouncing in the dock. When I click the app icon in the dock, then the dialog2 comes into focus. Any idea how I can get rid of this issue?
Here is my code:
on run
tell application "Finder"
set fileOpen to "Macintosh HD:Users:username:Desktop:Test.rtf" as alias
set filecontents to read fileOpen
repeat
set question to display dialog "I want to " buttons {"Help", "Add", "Subtract"} default button 2
set response to button returned of question
if response is equal to "Help" then
Help() of me
else
exit repeat
end if
end repeat
#Here is my Help Function
on Help()
display dialog "blah blah" buttons {"Cancel", "Continue"}
return
end Help
end tell
end run