In VS2010 is it possible to search within a certain file type only?
I want to search just my cs code and exclude .aspx files and VS generated code from datasets and edmx files.
Go to Find in Files and fill out your search string in Find What: and expand Find options and fill out Look at these file types: with *.cs.
Under Find and Replace/Find in Files (Ctrl+Shift+F), expand "Find options", then you'll notice a box called "look at these file types". Enter "*.cs" in there, and it'll only look at files with the .cs extension.
For more information, you may refer to http://msdn.microsoft.com/en-us/library/dechx2tz.aspx.
Use the Find in Files search.
You can specify the extensions of the files you want to search.
On the "Find in Files" dialog, there is a 'Look in these file types' option, under 'Find Options'
Related
When I click on 'Find All' in the 'Find and Replace' (CTRL + SHIFT + F), it is not returning me correct results.
I noted that in the Find output window, it says 'Total Files searched: 2'. So it is just searching two files for all the texts. When I searched for simple text like '{' or 'select', it returns me result from wwwroot\css file and still returns only two files.
In the find window, I've selected file type as : .cs;.vb;.resx;.xsd;.wsdl;.htm;.html;.aspx;.ascx;.asmx;.svc;.asax;.config;.asp;.asa;.cshtml;.vbhtml;.razor;.css;.xml and also selected Look in: 'Entire solution'
I've tried checking unchecking all options on page like Match Case, Match Whole Word, User Regular Expression, Include miscellaneous files etc. Nothing seem to be helping expand the search on other files. It still says Total Files Searched: 2.
Attached screenshot is an example that Title is available on the page I've opened in the background but search doesn't return that in result. The search is getting limited to two pages(two css files), it is not searching the entire solution.
Any pointers on how to fix it ?
Updating to most recent release fixed the search issue.
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.
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.
Is there any way to sort the "Open Files" section in the sidebar by alphabetical order?
The open files section of the sidebar is listed in the same order as the open tabs in the editor, so you can alphabetize the list by alphabetizing the tabs.
There is a plugin called SortTabs that will do this automatically. It also has a couple of other sorting options, including sorting by file type and last modified date.
sortTabs is the way to go as pointed out by Derrick. I would like to add, opening more than one instance of the same file, will not let the linter to work properly. sortTabs helps identify those duplicate instances. Although, written for Sublime Text 2, sortTabs also works well in ST3. Ctrl+Shift+P > sortTabs Menu > choose your sorting criteria.
Is it possible to exclude commented lines (either individual, or groups) from searches in Xcode?
If so, how can this be done?
No, you cannot exclude comment lines from Xcode search.
You can use "search scopes" to search more efficiently in Xcode:
Reference by Apple docs:
The refined search navigator allows all current search options and settings to be seen at a glance. The options are easily manipulated by clicking directly on them in the search navigator. You can set search scopes, including selecting multiple folders in a project, and save them by name for easy re-use. The search results display wraps to allow you to see ore results easily and quickly.