For Each loop and stop when certain name is found - sorting

So basically I am creating a simple application that gets all files in a folder. These files are listed inside a listbox and then when the user presses a button it will sort all the files into new folders based on a "breaking point" if you will. Ex: File 1.3ds, 2.3ds, 3.3ds and 4.error.3ds are listed in the listbox. I want the button to sort files 1.3ds, 2.3ds and 3.3ds into a folder and delete 4.error.3ds. Then the next folder would be 5.3ds, 6.3ds, 7.3ds and delete 8.error.3ds. Any suggestions on how to do this?
Folder Hierarchy would look like This
New Folder: Contains 1.3ds, 2.3ds and 3.ds
New Folder (1): Contains 5.3ds, 6.3ds and 7.3ds
I have a total of 54,000+ Files and doing this manually is not an option but it needs to be done.

Related

Show specific Quick Action for specific file extension

I am newbie with Applescript and Automator. I am trying to build a Quick Actions which will be able to propose different functions according to the type of file for example.
If the file is test.sh quick action will be a and b
If the file is document.pdf action will be c and d
I succeed in creating my actions but not to make them specific to file type. I don't know where to start as I don't see any possibility to make input conditional like if input = .sh do a and b.
Any help on how to proceed will be really appreciated.
Thank you,
After looking at the image of your QuickAction, it is not at all useful for anything other then a selected PDF document in Finder.
The first action should be a Set Value of Variable action so its contents can be retrieved multiple times using Get Value of Variable with however many Filter Finder Items actions needed to process the different file types, followed by the appropriate actions for each file type.
You would also use Ignore this action's input checkbox under Options for this action to detach it from the previous set of actions.
The image below shows a rough outline example of what I'm referring to:
Quick Actions are meant to be type-specific, so in general the best practice is to write one Quick Action for each file type. These quick actions will only appear in the Finder when files of that type are selected.
In many cases you can specify the file type when you create or edit the Quick Action in Automator. For instance, to create a Quick Action that appears only when PDF files are selected, set the pulldown menus at the top of the workflow to say "Workflow receives current PDF files in Finder":
then complete and save the Quick Action.
If you want more fine-tuned control over what types of files the Quick Action 'sees', you can edit its info.plist file and change its file types. After you've saved the Quick Action, navigate to ~/Library/Services in the Finder (that's the Services folder in the Library folder of your Home folder). Find the package with the name of the Quick Action (e.g., "Open in Preview"), control-click on it to get the contextual menu, choose Show Package Contents, and then open the Contents folder. You'll see the following:
Open that info.plist file in a plain-text text editor — I prefer BBEdit, but TextEdit will work fine if you make sure 'rich text' is turned off — and look for the NSSendFileTypes key. It will look something like the following:
<key>NSSendFileTypes</key>
<array>
<string>com.adobe.pdf</string>
</array>
com.adobe.pdf is a Uniform Type Identifier (UTI), and you can add or substitute in any system-recognized UTI. Here is the list of system-declared UTIs, but applications can declare their own UTIs and register them with the system, so this list is not necessarily exhaustive. For instance, if you want your Quick Action to send both PDFs and image files to Preview, you would search on the system-declared UTIs page and find that the base UTI for images is public.image, and then edit the info.plist to read:
<key>NSSendFileTypes</key>
<array>
<string>com.adobe.pdf</string>
<string>public.image</string>
</array>
Save this, and the Quick Action will now appear whenever you selected PDFs or images. Note that if you manually edit the info.plist file it might get overwritten if you edit and save the Quick Action in Automator.
Only the first two relevant Quick Actions will appear in the Finder window; any extras will be collapsed under the more button. To change the ordering so that the Quick Actions you use most are up first, open System Preferences, click the Extensions item, open the Finder section, and drag the items in the right-hand list into the order you prefer.

Is it possible to show files parent shared drive or the folder path in the document search view?

In the Google Picker (DocsView) I only see three columns: Name, Owner and Last Modified.
Is it possible to show informations about the file current location? As for now, if I have multiple files with the same name but located different folders, I can't distinguish the file I'm looking for.

What's the difference of Ignore Type in the Ignore Dialog of TortoiseGit?

What's the difference of Ignore Type in the Ignore Dialog of TortoiseGit?
Ignore Type:
1.Ignore item(s) only in the containing folder(s)
2.Ignore item(s) recursively
If I right-click on a folder and select one of the Ignore Type, the results are the same.
All folders and files in the selected folder will be ignored, including all subfolders.
Am I right?
In the first cases the selected file(name) is only ignored exactly in the folder which it is located.
In teh second case you can say that files matching the file you selected is also ignored in all subfolders recursively. This is e.g. helpful for ignoring *.tmp files in all subfolders.

How to search or filter in current folder by typing?

For example, in my current folder, have following files/folders:
myimage
myfolder
mytextfile
when I type: "tex", it moves the selection highlight to "mytextfile". Is that possible with finder?
The problem is that, I have many files and folders in my project folder, and I sometime can only remember its sub-name. Having this feature would be very useful.
Select the folder in the parent folder or press ⌘↑
Type ⌘F
Click on the name of your folder in Search Options (here "Documents")
Choose Name - contains in the search criteria
Type in the text field next to the search criteria.

CFileDialog - Selected filter and "Hint" showing all files

I have CFileDialog and set filter for it (Text files *.txt). When it opens, I see only TXT files, thats right. But! when I'm typing text into filename, the hint (under filename field) is showing all files (files with any extension).
Can be this behavior changed by some flag? I want force hint to show only TXT files.
...
CFileDialog f(TRUE,NULL,NULL,OFN_HIDEREADONLY|OFN_NOCHANGEDIR,_T("Text files (*.txt)|*.txt|All files (*.*)|*.*||"));
if( f.DoModal() != IDOK ) return;
...
My experience with this is that the file filter will control what is shown in the list of files, but when you type the auto-complete is matching against everything in the current directory. I can't think of a good way to prove that it can't be done, but I haven't seen anything in the MFC docs or code that would let you do that.
You can subclass the CFileDialog and override the CFileDialog::OnFileNameOK() function to reject the entry of any file name that doesn't match your criteria. you might also be able to get the functionality you want by overriding CFileDialog::OnFileNameChange() to reject a user supplied file name before they click the Open (or Save) button, but I have not done that myself to know exactly how it would work out.

Resources