Skip to main content
Known Participant
November 25, 2009
Answered

How can we get files list from a folder?

  • November 25, 2009
  • 1 reply
  • 1569 views

Hello All,

My plugin has to display the list of .ai files in the UI from C:\Program Files\Adobe\Adobe Illustrator CS4\Plug-ins\Illustrator Filters\MyPlugin folder.

Like, if we place "MyFile.ai" in "MyPlugin" folder, then UI has to display the MyFile (file name) in a combo box.

I want to get the files list from "MyPLugin" folder.

//get AI plugins folder

ai::FilePath pluginsFolder;

sAIFolders->FindFolder(kAIPluginsFolderType,

false, pluginsFolder);

//MyPlugin folder

ai::UnicodeString MyPluginFolder(pluginsFolder.GetFullPath( ));

MyPluginFolder.append( ai::UnicodeString ("\\Illustrator Effects\\Myplugin\\") );

Here I can get the my plugin folder complete path in "MyPluginFolder".

Now, from this folder I want to get the files list what I have placed?

What are the APIs available in AI to get the files list from a folder?

This topic has been closed for replies.
Correct answer A. Patterson

dont know anyone. surprising!!


If you want to enumerate files in a directory, you're going to have to use the OS APIs. AI does not provide anything for that. It provides ways to find important folders/directories related to AI, but nothing else.

The APIs for doing so in the OS are typically pretty easy to use though. Annoying if you're trying to hit Mac and Windows, but a little care in designing your interface and you hide the worst of it.

1 reply

November 26, 2009

Hi Manju,

     Take a look in SPRuntimeSuite,  there is a bunch of methods which plays with the plugin list. I think it may works for you,  you just try it out.

Sreejesh K V

Known Participant
November 26, 2009

Hi Rajesh,

Looked into the SPRuntimeSuite documentation, but didnt find any API that suites for me.

Let me explain my problem once again...

Look at the attached jpg, I want to get the files list (MyFile1.ai, MyFile2.ai ..etc in the jpg) from "MyPlugin" folder.

how can I do that? is there any API like

GetFilesList( char* fromThisFolder, char* outFilesList) ... ???

November 26, 2009

SPAPI SPErr(*  GetRuntimePluginList )(SPPluginListRef *pluginList) , does it help you? ,its in SPRuntimeSuite

You can try the SPFilesSuite also.