# \[Script\] Prompt user to select a palette (or use current)

**URL:** https://community.aseprite.org/t/script-prompt-user-to-select-a-palette-or-use-current/8397
**Category:** Scripts & Extensions
**Created:** [March 11, 2021, 4:30am UTC](https://community.aseprite.org/t/script-prompt-user-to-select-a-palette-or-use-current/8397 "2021-03-11T04:30:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sudo\_whoami](https://community.aseprite.org/user_avatar/community.aseprite.org/sudo_whoami/32/6531_2.png) [@sudo\_whoami](https://community.aseprite.org/u/sudo_whoami)
#### Post date: [March 11, 2021, 4:30am UTC](https://community.aseprite.org/t/script-prompt-user-to-select-a-palette-or-use-current/8397/1 "2021-03-11T04:30:05Z")

</div>

How can I set up a dialog to prompt the user to select a palette from the built-in palettes (and then change the current palette as needed) or allow them to choose to use whatever the current palette is?

---

<div class="post-metadata">

### Author: ![Olga\_Galvanova](https://community.aseprite.org/user_avatar/community.aseprite.org/olga_galvanova/32/3294_2.png) [@Olga\_Galvanova](https://community.aseprite.org/u/Olga_Galvanova)
#### Post date: [March 11, 2021, 8:09am UTC](https://community.aseprite.org/t/script-prompt-user-to-select-a-palette-or-use-current/8397/2 "2021-03-11T08:09:04Z")

</div>

the easiest way is to summon [app.alert()](https://github.com/aseprite/api/blob/master/api/app.md#appAlert) window

```
app.alert{
	title = "ALERT",
	text = {
		"Select a palette.",
		"Do it now!"
	} 
}

```

however that will prevent user to do anything unless they click on a button. if you don’t want that, you’ll have to create your own alert window through [dialog()](https://github.com/aseprite/api/blob/master/api/dialog.md#dialog)

```
local dlgAlert = Dialog{ title = "ALERT" } 

dlgAlert 
	:label { text="Select a palette." }
	:newrow()
	:label { text="Do it now!" } 
	:button { 
		text="Close",
		onclick = function()
			dlgAlert:close()
        end 
	}
					
dlgAlert:show{ wait=false }
```
