Possible with scripting? List from file names in a folder

Hello community.

I suck at scripting. I can usually re-tool scripts to suit my need but I fall short when pressed to start a script fresh. So I’m coming to the community for help.

I have a vision for a script. In short, I have a folder on text files saved in iCloud. I’m trying to accomplish a script action that would populates a list using the filenames (without the file extension) then adds the selection as a draft title.

I’m clueless where to start. Is such a script possible within Drafts? What UI/coding skills would I need to pull this off?

Thanks for helping! I appreciate anyone taking time to assist.


Sounds kind of similar to this.

But there’s been no advancement on the addition of directory listing methods just yet - at least according to the latest beta documentation for the FileManager object.

I need to bump that up on the feature list. Should be something that is supported soon.


I have a similar problem. I have 20 or saw projects in Bear. they change periodically, so the list is dynamic, but they all contain a tag, #project (of all things).

I want to call up a list of all the projects, select one, and append the contents of Draft into that project.

Is that doable?

It seems similar to the original problem, but an extension of it. If that is not the case, I apologize for jumping in on the conversation.

It actually seems very different. It isn’t something to do with file system folder listing, but accessing tags in Bear.

Bear doesn’t appear to offer an API, only callback URLs; much the same way as Drafts.

The Bear URL Scheme offers a tags option that looks like it might return what you need.