Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help with Applescript Dialogs

Featured Replies

code:


display dialog "Please enter your password..." default answer "" default button "OK" giving up after 5

copy (dialog reply button returned) to v_button


I run the dialog and get an "Execution Error" message. It says "Cannot make some data into the expected type".

I am sure that I have some formatting errors, but I do not know what. Any suggestions?

Kurt:

What are you trying to do here?

display dialog "Enter PW" default answer "" buttons {"OK"} default button 1

set v_button to button returned of result as string

display dialog v_button

will return and display the name of the button clicked

whereas

display dialog "Enter PW" default answer "" buttons {"OK"} default button 1

set pw_text to text returned of result as string

will capture what's entered in the text box

Old Advance Man

  • Author

Basically I am trying to do 2 things. One is to make sure that the user pressed the "OK" button and if so capture the text that they entered into the "Password" field.

I am sure that my process is correct, I am just having touble with the syntax. I'll try your suggested format and see what the results are.

quote:

Basically I am trying to do 2 things. One is to make sure that the user pressed the "OK" button and if so capture the text that they entered into the "Password" field.


here a little solution.

set PWT to ""

set PW to {text returned:PWT, button returned:"", gave up:false}

repeat until (gave up of PW is true) or (text returned of PW is not PWT)

set PW to (display dialog "Enter PW" default answer "" buttons {"OK"} default button 1 giving up after 5)

end repeat

if gave up of PW is false then

-- something using (text returned of PW)

else

-- other thing

end if

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.