Problem modifying script to allow user to select from list of options

Hello,

I am trying to modify a script to allow the user to make a selection from a list of options before the script is processed, but I’m running into trouble. The first script below works fine, but when I try to run the second one, and, for example, select “Clippings-Religion”, I get this error: “VoodooPad Pro got an error: Can’t make page {“Clippings-Religion”} of document 1 into type page.” Can anyone see why this script isn’t working as desired?

Thank you,
Erik

FIRST SCRIPT:


tell application "Firefox"
	activate
	
	set theURL to «class curl» of window 1
	set theTitle to name of window 1
	tell application "System Events" to keystroke "c" using {command down}
end tell

set thetext to "-----------------------------------------------------------------------" & return & ¬
	theTitle & return ¬
	& return & theURL & return ¬
	& return & (the clipboard) & return & return

tell application "VoodooPad Pro"
	append text return & thetext to page "Clippings-Religion" of document 1
end tell

SECOND SCRIPT:


set pageList to {"Clippings-Religion", "Clippings-Education", "Clippings-Environment", "Clippings-Iraq", "Clippings-Iran", "Clippings-North Korea", "Clippings-Energy", "Clippings-Health Care", "Clippings-Discourse", "Clippings-Leadership", "Clippings-Other", "Cancel"}

set PageToPasteTo to choose from list pageList with multiple selections allowed

tell application "Firefox"
   activate
   
   set theURL to «class curl» of window 1
   set theTitle to name of window 1
   tell application "System Events" to keystroke "c" using {command down}
end tell

set thetext to "-----------------------------------------------------------------------" & return & ¬
   theTitle & return ¬
   & return & theURL & return ¬
   & return & (the clipboard) & return & return


tell application "VoodooPad Pro"
   append text return & thetext to page PageToPasteTo of document 1
end tell 

choose from list always returns a list.

For a single item, you could use this:

set PageToPasteTo to choose from list pageList
if result is false then error number -128 -- Cancel
set PageToPasteTo to first item of PageToPasteTo

For multiple items, you would likely need to use a repeat later on:

set PageToPasteTo to choose from list pageList
if result is false then error number -128 -- Cancel

-- The rest of your script

tell application "VoodooPad Pro"
	repeat with thisItem in PageToPasteTo
		append text return & thetext to page thisItem of document 1
	end
end tell