List Box Object - Add Files

Adds file items to a List Box Object. A file item is just like a regular list box item, but instead of specifying the item text to display in the list box, you provide a full path and filename to put in the item's associated data instead. The action will automatically parse the path and filename to come up with a shortened version to display as the item text.

For example, if you used this action to add "C:\My Files\foo.txt" to a List Box Object, you could have it show up in the List Box Object as just "foo.txt" instead—or even as "My Files\foo". The full path and filename ("C:\My Files\foo.txt") would be stored as the data for the item. This is just like using a "List Box Object - Add" action to add "foo.txt::C:\My Files\foo.txt", except that the part on the left side of the :: (the "foo.txt" part) is automatically calculated for you.

Use this action whenever you want to display a list of filenames in a List Box Object, but want to be able to use the full path when the user selects a file in the list box.

TIP

 

 

 

A good use for this action would be to add the results of a "File - Search" action to a List Box Object.

Action ID:
Action Category:
Action List Syntax:

119
List Box Object
ListBoxObject.AddFiles (<<ADDTYPE>>, <<ITEM>>)

Settings

List Box

Name:

The name of the List Box Object that you want to add items to.

Add at Position

The position in the list where you would like to add the new items. Choose from:

Start

-

Add the items to the start of the list.

End

-

Add the items to the end of the list.

Specific position

-

Add the items at the position specified in the Index field.

Index:

The zero-based index where the new items will be added in the list. A value of 0 will add the items to the beginning of the list, and a value of -1 will add the items to the end of the list.

NOTE

 

 

 

The action will automatically compensate for out of bounds indexes: anything less than -1 will go to the start of the list, and anything greater than the number of items in the list will go to the end of the list.

If the list has the Sort option turned on, the Index setting has no effect.

Items

Items to add:

The file item(s) to add to the List Box Object.

NOTE

 

 

 

This action will NOT add empty items to the list. Any empty file items are simply ignored.

Delimiter:

The delimiter that you used to separate items in the Items to add field. If the text in the Items to add field is not a delimited list, you can leave this field blank.

Information to display

The type of information to display in the List Box Object. (This determines what will be displayed in the List Box Object based on each file item you add.) Choose from:

Full path and filename

-

Display the full path and filename in the list box. (example)

Folder and filename only

-

Display the full path and filename in the list box, but with the drive letter (and the initial backslash) removed. (example)

Filename only

-

Display only the filename in the list box. (example)

NOTE

 

 

 

The full path to the file will always be stored as the items data—this option simply affects what is displayed in the list box.

Show file extension

Controls whether the file extensions will be displayed in the list box.

Enable this option if you want the file extensions to appear. (example)

Disable this option if you want to hide the file extensions in the list box. (example)

Error Codes

Value
(%LastErrorNum%)

Simple Message
(%LastErrorMsg%)

Verbose Message
(%LastErrorDetails%)

0 (OK)

 

 

1

MSG_ERR_LIST_BOX_OBJECT_ADD_FILES

MSG_ERR_LIST_BOX_OBJECT_ADD_FILES
MSG_ERR_OBJECT_NOT_FOUND
<<LISTNAME>>

2

MSG_ERR_LIST_BOX_OBJECT_ADD_FILES

MSG_ERR_LIST_BOX_OBJECT_ADD_FILES
MSG_ERR_LIST_BOX_OBJECT_UNAVAILABLE
<<LISTNAME>>

Examples

Adding a single file item

Searching for MP3s and adding them to a list box