Button with dynamic Files popup menu

Hi, how can I achieve the following:

A button which when clicked drops down a popup menu where the items in this popup menu represent the files of a specific directory. So when I click one of these popup menu items the according file will be opened.

The definition of the popup menu items should be dynamic, so when a new file is created inside the corresponing directory then the popup menu will automatically be updated.

Go FOLDERCONTENT

Several extra arguments are available with this command (e.g. showempty, showhidden, maxdepth etc.).

[quote="PeterPanino"]Hi, how can I achieve the following:

A button which when clicked drops down a popup menu where the items in this popup menu represent the files of a specific directory. So when I click one of these popup menu items the according file will be opened.

The definition of the popup menu items should be dynamic, so when a new file is created inside the corresponing directory then the popup menu will automatically be updated.[/quote]

There are a bunch of examples in this thread:

[Adding Cascading Folder Content to your context menus)

(The thread is about adding something similar to the right-click menu for folders, but much of it applies here as well.)