PrefsStorageLib List or array

I’m trying to read/store a list of records for use on the next launch of a script.
if I edit the plist in xcode so that theList is

    <array>
	<string>22</string>
	<string>33</string>
	<string>42</string>
</array>

How do read that into the variable theList using PrefsStorageLib?

If the plist you refer to is your app’s preference file, you should not edit it directly.

Can you explain in more detail what you’re trying to achieve?

I have a labeled popup with a list of options available. I need to be able to read/define those options without hard coding them into the app.

Can we get a bit more detail? Is this an Xcode-based app? How do you plan to define the options?

PrefsStorageLib is designed for apps to store their own preferences, but as you describe it, that’s not what you are after.

Apologies.
I am hoping to be able to reset an array and to set up the array if its not set.

use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use scripting additions
use script "Dialog Toolkit Plus" version "1.1.0"
use script "PrefsStorageLib" version "1.0.0"
prepare storage for (path to me) default values {theList:{}}
set theList to value for key "theList"
set theTask to value for key "theTask"
if theList is {} then
	set accViewWidth to 200
	set {theButtons, minWidth} to create buttons {"Close", "More"} button keys {"", "2", "1", ""} default button 2 cancel button 1
	if minWidth > accViewWidth then set accViewWidth to minWidth -- make sure buttons fit
	set {theField, theTop} to create field "" placeholder text "use comma to separate values" bottom 0 field width accViewWidth extra height 2 --with accepts linebreak and tab
	set {buttonName, controlsResults} to display enhanced window "" acc view width accViewWidth acc view height theTop acc view controls {theField} buttons theButtons active field theField initial position {0, 0} --with align cancel button
	set theList to controlsResults
	set theList to value for key "theList"
end if

set accViewWidth to 400
set {theButtons, minWidth} to create buttons {"reset prefs", "Close", "More"} button keys {"", "2", "1", ""} default button 3 --cancel button 1
if minWidth > accViewWidth then set accViewWidth to minWidth -- make sure buttons fit
set {theField, theTop} to create field "" placeholder text theTask bottom 0 field width accViewWidth extra height 2 --with accepts linebreak and tab
set {taskPopup, popupLabel, theTop} to create labeled popup theList bottom (theTop + 5) popup width 180 max width accViewWidth label text "Set Status:" popup left 75 initial choice theTask
set {buttonName, controlsResults} to display enhanced window "" acc view width accViewWidth acc view height theTop acc view controls {theField, taskPopup, popupLabel} buttons theButtons active field theField initial position {0, 0} --with align cancel button
set {scanSku, theTask} to controlsResults
assign value theTask to key "theTask"
assign value theList to key "theList"
if buttonName is "reset prefs" then
	remove value for key "theList"
	remove value for key "theTask"
end if

hitting the 'reset prefs" button is working but I’m struggle to set the array. I hoping to be able to type “option1”,“option2” in the first dialog and they become option for the labeled popup in the second window.

You have to convert the comma-delimited string into a list yourself. So:

	set {buttonName, controlsResults} to display enhanced window "" acc view width accViewWidth acc view height theTop acc view controls {theField} buttons theButtons active field theField initial position {0, 0} --with align cancel button
	set fieldValue to item 1 of controlsResults
	set {saveTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {","}}
	set theList to text items of fieldValue
	set AppleScript's text item delimiters to saveTID
	assign value theList to key "theList"

And similarly after the second dialog.

DUH!! That was so rookie. Thank you.