choose from list issues

Hi I have three issues for the following code:

set optList to {60, 50, 30, 25, 15, 10, 6}
set theChoice to choose from list optList with prompt “Choose frame rate (fps)” OK button name “Choose” default items {15} without multiple selections allowed

  1. Since I am running this script as a droplet the choose from list dialog that comes up lies in the background and you have to click on the running applescript application on the dock in order to be able to choose from the list. I want to bring it to the front (kinda like tell application “System Events”
    activate
    end tell )

  2. I want to get rid of the ‘cancel’ button on the choose from list dialog that comes up.

  3. I want it to select the default value if the user hasn’t done anything for a certain amount of time (kind alike ‘giving up after’ in display dialog)

Also, is there any way to easily replace the choose from list box with a slider bar with various options?

cheers,
sh

perhaps it might be more useful to use a scripting addition? i know the 24u appearance osax is capable of handling all of your problems easily. the only choice you would have to make is to pay the subscription fee or just have reminder boxes keep popping up whenever you use one of their additions.

  1. Um. activate?
activate
set optList to {60, 50, 30, 25, 15, 10, 6}
-- etc.
  1. You can’t. If you have to, you can make the user choose something
activate
set optList to {60, 50, 30, 25, 15, 10, 6}
set theChoice to false

repeat
	choose from list optList with prompt "Choose frame rate (fps)" default items {15} OK button name "Choose" cancel button name ""
	set theChoice to item 1 of result
	if theChoice is not false then exit repeat
end repeat

  1. You can’t directly. I tried using timeout statements, but I couldn’t get it to work the way I wanted it to.

Also) Do you consider AppleScript Studio easy?

Reading through this thread and noticed Only The Snake’s encouragement to use 24U Software’s additions. A reminder that shareware is not freeware. The licensing guide included in the 24U Appearance OSAX 3.0.1 clearly states:

If you are not into learning a bit of Studio, the 36 bucks is pretty inexpensive.

Imagine if everybody took and no one gave.

-N

inexpensive though it may be, some people (especially students like me) cannot afford to spend money as freely as they like. if i had the money, i’d buy a license for every shareware product i own. alas, i am not a hilton child :rolleyes:.

This may be all you have to work with:



on open TheFile

		
		activate
		
		set optList to {60, 50, 30, 25, 15, 10, 6}
		
		set FrameRate to (choose from list optList with prompt "Choose Frame Rate (FPS)" default items {item 3 of optList}) as text

end open


This seems like a somewhat contradictory statement.

– Rob

You could use a dialog instead. It would of course mean that you have to type your answer in.

activate
set optList to {60, 50, 30, 25, 15, 10, 6}
display dialog "Choose your frame rate (fps)- 60,50,30,25,15,10, or 6." default answer "30" buttons {"Choose"} default button "Choose" giving up after 10

Hmm it seemns kinda silly that display dialog offers the timeout option and the button specification option but choose from list does not, seeing as they basically provide the same functionality.

Hi Snowey,

Did you know that AppleScript Studio is free and probably on your computer. All you need to do is install it with the installer.

Anyway, another idea might be to use ‘display dialog’ first. Ask the users if they would like to choose an item from the list. If it times out then just use the default item.

gl,