Cocoa: Is there a way to delete a few files at once? - objective-c

Is there a way similar to removeItemAtPath: that allows removing of a few files at once? It should not all the files in a directory but can be a few of them only. E.g. you feed the method a few file paths in an array.

Create a collection of the items you wish to delete, loop over the collection and delete them the same way you'd delete a single file.

Related

NSOpenPanel preselect multiple files

While there is quite a few questions about how to preselect a file on NSOpenPanel, they set openPanel.directoryURL to the path of the target file. However NSOpenPanel can allow for multiple files to be selected via the openPanel.allowsMultipleSelection property. Is there a way to preselect multiple files?
The intuitive way would be to set openPanel.urls but that is read-only.

Is there a way to iterate all sub-files inside a .blend file's directories?

So my end goal is to link all brushes from one blend file into another via a script. I know I can link one brush by using the following:
bpy.ops.wm.link(directory="F:/Blender/Scenes/brushes.blend/Brush", filename="CustomBrushForImport")
I also know I can iterate through a folder of files by using the following in python (currently using print so I can visualize what's happening in console)
for filename in os.listdir(testDirectory):
print (filename)
AFAIK (from what I've tried), I cannot use os.listdir to access anything inside the .blend file (i.e. F:/Blender/Scenes/brushes.blend/Brush), but I don't know of any other functions that operate similarly but for this unique sub-directory. Is there some way to do the same method, or should I just look at creating a list of brushes instead and checking for those brushes inside the .blend file?
Thanks!

Is it possible to write multiple variables inside a path when saving document in uipath

I am in the process of saving a pdf-file after downloading it on the browser. I have to put in two variables inside the file path (gotten from excel sheet, column A and B) to be able to save it in the right folder. Uipath will somehow not allow me to save it. Is there something wrong with the way I am typing in the variables inside or do I have to try another way?
BR
Salam Katawazi

list view files in .NET

Can anybody tell how to list view opened files in VB.NET.
The opened files should be seen in list view at the left part of GUI.
You can manually track open files, for example, by keeping a collection that contains their names. Once a new file is open, a new item containing the file path is added to the collection. When a specific file is closed, that item is removed from the collection.
Note: The collection I am talking about can have different data for specific files, not only file paths.
Given you have that collection, you can easily bind it to a ListView control.

How do I put a listing of files into a menu?

I have a folder with .txt files in it. How can i make my menuitem get those .txt files and put the filenames in the menuitem, so that it creates a list of all .txt files in that folder.
So when i put a .txt in the folder the program automatically creates the menu item.
Does someone knows how to do this, or perhaps an example?
Unless you're using ASP.Net, you're looking for the FileSystemWatcher and Directory classes.
Basically, you need to call Directory.GetFiles and loop through the results creating MenuItems.
Then, handle the FileSystemWatcher events and either rebuild the menu from scratch (simpler) or update the appropriate item (faster)