Advertisements

Blog Archives

how to find anything on your mac

top shot
 
With the release of FT2 2.13 comes a new SuperSearch function. You can use this to find anything on your mac or connected drives, open folders (including hidden ones) and launch apps. You can open SuperSearch quickly by holding down the shift key when you click the F2 icon in the status bar.

If you’re familiar with EasyFind and Spotlight, you can think of SuperSearch as sort of a ‘Spotlight on Steroids’ (use the ‘Faster’ option’) combined with an ‘EasyFind without the overhead’ (use the ‘Deeper’ option). SuperSearch supports using the spacebar to open Quick Look and double-clicking to reveal an item in the Finder.

For the most part, you’ll want to use the options ‘Faster’, ‘String’ and alternate between ‘Name’ (for files) or ‘Content’ (for text within files). Choose to include case sensitivity, emails and web history as needed. However, there’s a lot of different ways you can use SuperSearch. Here’s a few examples:

Find hidden files
(use ‘Deeper’, ‘Name’, ‘String’)
 
first shot

Find files by bundle identifier
(use ‘Deeper’, ‘Name’, ‘String’)
 
Screen Shot 2016-06-05 at 17.16.32

Open folders in the Finder
(just type the path and hit return; use ~/ to target the home folder; the options are not relevant)
 
second shot
 
Search for text in files
(use ‘Faster’, ‘Content’, ‘String’ for speed, or use ‘Deeper’ if you want to target a particular drive or directory, or if you want to search for content within hidden files and packages, too).

When you use ‘Deeper’ to search for content, the item name includes a hit count of the number of occurrences of the search term in that file:
 
shot three

Launch applications
(prefix the app name with ` (that’s the key directly above the ‘tab’ key) to tell SuperSearch you want to open it rather than find it. The options are not relevant).
 
shot four

🙂
 

Advertisements

how to use AppleScript to help you use AppleScript!

AppleScript search tool


Learning AppleScript can be frustrating. You need a good book, lots of patience, and core documentation like the AppleScript Language Guide and the annual release notes, but most of all you’re going to need access to instant advice. It’s in this last respect that we’re going to build a helpful little AppleScript tool to help us solve AppleScript problems.

The two best places to get help from are Apple’s AppleScript mail list and MacScripter. So, basically, we’re going to combine a couple of tools that you’ve already got (or can get for free) on your mac into a single keystroke-activated, dedicated search engine. When finished, we’ll be able to do something as simple as pressing cmd-ctl-S, type in a short search term like “display dialog” and get specific results for AppleScript.

Our tool basically relies on that fact that in Google you can do site specific searches by using the site: keyword. We’ll then add a couple of AppleScript-specific choices and use a free tool, Red Sweater’s FastScripts, to allow us to assign an easy shortcut (you could assign the keyboard shortcut without FastScripts using Mac’s Services menu, but FastScripts is a great tool you should have anyway if you’re using AppleScript, so now’s a good time to go get it!).

To get started, let’s open Script Editor and start a new script. Our script is really short, and not very complicated, here it is:


set theChoices to display dialog "Search for what?" default answer "" with title "AppleScript Search" buttons {"Cancel", "ASUsersList", "MacScripter"} default button "MacScripter"

set searchTerm to the text returned of the theChoices
set theSite to button returned of theChoices
tell application "Safari"

  activate

  if theSite = "ASUsersList" then
   search the web for "site:http://lists.apple.com/archives/applescript-users " & searchTerm
  else
   search the web for "site:http://macscripter.net " & searchTerm
  end if
end tell

Run the script now, and try a couple of searches. I’ve plugged in MacScripter and ASUsers List, you might like to play with a “choose from list” and add stackOverflow, OS X Technologies or any other sites you know of. Not sure how to do that? OK, try searching for “choose from list” with your new tool, and you’ll soon find out how!

Once you’re finished with the script, use FastScripts or Services to create a shortcut. Now, the next time you’re working in Script Editor and get stuck writing a script or keep stalling over some persistent error message, just hit your shortcut and type in an appropriate search term.

Fast and simple! Automation, that’s what it’s all about!

Addendum: If you’re feeling very ambitious and want to combine several sites into one set of search results, Google allows you to set up your own personal search engine for free.


advanced search in Preview

searching_for_light


Unlike Adobe Acrobat, you won’t find any complicated advanced search boxes in Preview, but that doesn’t mean you have any less power to find exactly what you want. Feel free to open up a pdf that you can play around with as we go along.

Finding stuff
Preview does all its searching in the spotlight-like filter field in the top right, and you access it either by clicking in it or hitting ‘command-F’.

Simply typing in a few letters will return every page that contains that string, either as a word or a partial word. If you want to restrict the results to complete words – say you type in ’cause’ but you don’t want it to return ‘because’, then add double quote marks around what you type.

"cause"

If you add another word (or words), also in double quotes, this is effectively telling Preview to return only those pages that contain all those complete words on the same page. Thus

"cause" "pattern" "function"

will only return pages in your pdf document that contain all three of those terms. This is the same effect you get when you put the ampersand ‘&’ between words (the logical AND), but the & is automatically implied by default, so there’s no need to actually type it.

What if you want to return all pages that have either “cause” or “function” in them? In this case, you use the ‘|’ sheffer stroke (hold down shift and hit the backward slash key, up their above the return key!).

Note for the techies: Preview doesn’t distinguish between NOR and NAND. Though both are valid input, one sheffer stroke will return the same as two.

As with the logical ‘AND’ function, you can have as many terms as you want. For example, if you wanted to return every page that had a numeral in it, you could use

"1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "0"

That would return every instance of any one of those digits on their own, but it wouldn’t return a page that had, say, ‘2014’ in it. Remember that the quote marks indicate whole expressions, not parts. To get any number, do the same without the quotes:

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0

You could even combine this with word searches:

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | one | two | three | four | five | six | seven | eight | nine | "ten" | eleven | twelve | thirteen | fourteen | fifteen | sixteen | seventeen | eighteen | nineteen | twenty | thirty | forty | fifty | sixty | seventy | eighty | ninety | hundred | thousand | million | billion | trillion | zero | nought | nil

That would return every mention of any number in numerals or words. Note that “ten” is delimited as a complete word due to the number of false positives that would arise from words with those three letters (heighten, often, tendency, etc). Also notice the various synonyms for ‘zero’ at the end of the search term. Even so, it isn’t quite complete – the assiduous search-hound would probably want to add ordinals, ‘1st’, ‘first’, ‘2nd’, ‘second’ and so on, but I’ll leave that as an exercise for the reader.

Organising results
OK, so you’ve got your results, what can you do with them? First of all, note that you’ve got some options above the search sidebar. You can list by page order from beginning to end of the document, or by number of hits per page with ‘Search Rank’. Highest number of matches on a page appears at the top of the results and the rest follow in descending order.

Screen Shot 2014-03-22 at 00.10.14

Secondly, you can cycle backwards and forward through the hits on each page by using ‘command-G’ and ‘command-shift-G’, respectively. That’s a whole lot less laborious than clicking the tiny forward and backward arrows under the filter field, but that way is available too.

filter bar

The filter field
Finally, don’t forget that you can move the cursor around in the filter field with a few shortcuts: both ‘control-E’ and command-right arrow will put the cursor to end of the search term, while ‘control-A’ and command-left arrow will put it at the beginning. You can also use ‘control-K’ to delete everything from the cursor to the end of the search term, which can be handy if you have a lengthy search term that you want to cut in half. Move the cursor to where you want the search term to end, and hit ‘control-K’ to delete all subsequent characters.

Hopefully, that should give you some pretty good ideas on how to power search in Preview. Who needs ‘advanced search’ dialog boxes? Not us! 🙂

featured picture: searching for light by HealingRock

5 things you never knew about Spotlight

spotlight_icon

Whenever I’m helping customers with a misbehaving Mac, one of the most common things I hear is ‘Wow, I didn’t know you could do that with Spotlight!’ Whereas the average user will navigate around their computer by trawling through Finder, the savvy user knows how to get to places, launch apps, search the internet and calculate their tax with a few simple Spotlight tricks. In this post we’ll look at how to increase your productivity by using Spotlight for fast access to a variety of common functions. But first, we need to get Spotlight set up for maximum efficiency.

Set up the hotkey
To get the most out of Spotlight, the first thing to do is set up the keyboard hotkey. By default, this is usually ‘command-spacebar’, but if you are using multiple languages you might want to reserve that for the Input Switcher. Instead, I use ‘option-command-spacebar’, not least because this nice 3-finger combination can be executed with the left-hand while the right hand is reaching for the coffee mug… 😉

Whatever your choice of hotkey, keep it close to the bottom of the keyboard, as the other keys that you will want to be able to rapidly access are the cursor arrows and the ‘return’ key. If you haven’t set up your Spotlight hotkey yet, the fastest way to do so is to click on Spotlight on the top right of your screen with the mouse or trackpad and type 

spot 

and then hit ‘return’ on the keyboard (if Spotlight isn’t the top hit, just use the arrow down key to move down till you hit it)


Spotlight

After hitting ‘return’, you’ll be presented with the Spotlight preferences panel. At the bottom, you’ll see fields to define both the Spotlight menu keyboard shortcut and the Spotlight window keyboard shortcut. For the purposes of this post, we’re only interested in the menu shortcut (but feel free to set up the window one too, if you wish!). Once your hotkey is set up you can forget about the annoying inconvenience of dragging your cursor up to the top right corner. Just hit your hotkey combination to open the Spotlight search field.


System Prefs for Spotlight


But don't close the Spotlight prefs just yet. The main pane in the window is the Search Results panel which lists the order in which results appear. You can alter the order of results that Spotlight shows by dragging items up and down the list. Altering this to your likes is a big part of getting the most out of Spotlight. If Spotlight is always showing you lots of results from Mail that you don't want to see, for example, drag "Messages & Chats" to the bottom of the list.

For the purposes of this tip, make sure Applications is no.1 in the list and System Prefs no. 2, and Folders at no. 3. Follow that with Documents, Images, PDFs and so on according to the kind of files you access most often on a daily basis. A set up like this will make Spotlight much more efficient at navigating around your mac, and once you get the hang of it you’ll find yourself trawling through Finder much less often.

Incidentally, I don't recommend unchecking any of those boxes. We want more power in our searches, not less; you never know when you might be looking for something that just won’t show up in a search because you’ve forgotten that you excluded those results in Spotlight’s preferences. Besides, there are better ways to restrict your searches in Spotlight like this and this.

When you're done with setting up Spotlight’s preferences, hit 'command' and 'Q' to close System Preferences and read on.


1. Use Spotlight as an App Launcher
Long before the Apple engineers dreamed up Launchpad, many of us were already launching apps in half the time it takes in the Dock, Finder, or (now) even Launchpad itself. You can open any app with Spotlight just by typing three or four characters. Sometimes, just one is enough! All you need to do is hit your hotkey (see above) and type the first three or four letters of the App’s name and hit ‘return’.

Try typing tex and hitting ‘return’ to instantly open TextEdit, or act for ‘Activity Monitor’. iPhoto should be the top hit with ip. If you use Terminal a lot, there’s no need to go rooting around in the Applications/Utilities menu to open it. Simply hit the Spotlight hotkey and type

term

and hit ‘return’.

If you have Carbon Copy Cloner, type CCC, and if you use 1Password, just the number 1 and return should do the trick.

saf will open Safari and mai will launch Mail in an instant. Experiment with your favourite or most commonly used apps and you’ll find that using Spotlight is twice as fast as any other method.

As a bonus, if you moved Folders up to no.3 in the Preferences list, experiment with the first few letters of your favourite folders. Try some of these and see what comes up as the top hit:

home, downl, mov, musi, docu.

2. Use Spotlight to access System Prefs
We already saw one of Spotlight’s hidden uses – fast access to System Preferences. In fact you can do this with any of them. Want to check your login items in Users & Accounts | Login Items? No need to go clicking all round the desktop, hit your Spotlight hotkey and type

user

or

secu

if you want to change your Security preferences quickly.

Don’t hit ‘return’ just yet – check to see what is the ‘top hit’, as you might find that you have to “arrow down” an item or two. Even so, this is a whole lot faster than wading through either Finder or the  menu.

Typing

sys

and hitting ‘return’ is also a fast way to open the main System Preferences panel.

3. Dictionary
Hit the Spotlight hotkey and try typing the word 

codec

Just press ‘command-L’ to go straight to the dictionary entry and see its definition in a pop-up panel. Alternatively, hit ‘command-D’ to open the word in the Dictionary app.

Also note that in Spotlight, you can jump around by holding down the ‘command’ key and pressing the down arrow key (each press of the arrow key conveniently takes you to the top of each section; release the ‘command’ key and use the down arrow alone to move one item at a time within the section). Using the ‘control’ key and the down or up arrow takes you to the very bottom or the very top of the list, respectively.

When you’re done with Spotlight, just hit your hotkey combination again to dismiss it. You can also use the ‘esc’ key here: one tap of ‘esc’ will clear the Spotlight search bar, two will dismiss it.

4. Website search
But suppose you type in a word that Dictionary.app doesn’t know? Try

plomic

Again, use your command and arrow key to jump down to the bottom of the results and this time choose ‘search the web’. That will automatically open Safari and put the term in the search bar and return the results. But you’re not limited to dictionary searches, you can use Spotlight’s search bar just like the Google search bar in Safari. Try typing in

mini ipad versus samsung galaxy review

or

best small car of 2012

or anything else you might want to search the web for. Yep, Spotlight isn’t just a file finder on your mac – it’s a google search engine, too!

5. Use Spotlight as a Calculator
Want to quickly know what 17.5% of $45,000 is? Hit your Spotlight hotkey and type:

45000*17.5%

Don’t press ‘return’ – difficult to break that habit, I know! – the result is already listed next to the ‘Calculator’ icon, just look down to see the search results and the answer is already there!

You can of course do all the standard calculator functions like / for divide, * for multiplication and + and – for addition and subtraction. You can even do powers (3 to the power of 5 = 3^5) as well as bracket expansion. Try

(3x5)^2 and compare the result with 3*5^2

So whether its App launching, web searching, opening system prefs or using the dictionary or calculator, hitting your Spotlight hotkey is a habit you want to develop for faster computing. At least for me, it’s probably the most frequent keystroke I use on a daily basis.

🙂

%d bloggers like this: