[OS X TeX] How to make locate/spotlight search ~/Library/texmf
Alan Munn
amunn at gmx.com
Tue Aug 10 18:00:27 EDT 2010
On Aug 10, 2010, at 5:04 PM, Dr. Clea F. Rees wrote:
> On Tue 10th Aug, 2010 at 13:32, Michael Sharpe seems to have written:
>
>>
>> On Aug 10, 2010, at 10:41 AM, Alan Munn wrote:
>>
>>> On Aug 10, 2010, at 1:35 PM, Herbert Schulz wrote:
>>>
>>>>
>>>> On Aug 10, 2010, at 12:16 PM, Alan Munn wrote:
>>>>
>>>>>
>>>>> On Aug 10, 2010, at 12:51 PM, Herbert Schulz wrote:
>>>>>
>>>>>>
>>>>>> On Aug 10, 2010, at 11:22 AM, Alan Munn wrote:
>>>>>>
>>>>>>> Hi, I can use the locate command in a Terminal to quickly
>>>>>>> find files in /usr/local/texlive. However, it doesn't find
>>>>>>> files in ~/Library/texmf. How do I make it do that?
>>>>>>>
>>>>>>
>>>>>> I'd guess that the locate database won't contain anything in
>>>>>> the Users folder since that is private for each individual
>>>>>> user. Perhaps there is a way to ell it to build a personal
>>>>>> database.
>>>>>>
> There is. Or, at least, it can be done for GNU locate. I installed
> that
> as glocate and then build both a general database and a personal
> database. I then use locate to search the generic, system-wide
> database
> which gets updated once a week, I think, or glocate to search both a
> system-wide and personal database both of which are updated daily.
>
> I can't remember why I did it this way so I'm not sure if you could do
> the same with the default locate or not.
>
> Let me know if you want further details.
Hi Clea, yes, I would like to see the details if it's not too much
trouble to recreate them.
>>>>>>
>>>>>> I've been using `Find Any File', <http://apps.tempel.org/FindAnyFile/index.html
>>>>>> >, and I'm quite happy with it.
>>>>>
>>>>> Yes, I have that too, but I'm lazy... For most quick searches
>>>>> command-space is simply more convenient. I'd just like to be
>>>>> able to find things in my local texmf folder as easily. If
>>>>> locate could do that, that would be fine, since I've always got
>>>>> a terminal window open; if it can't, I'd prefer to use Spotlight
>>>>> if possible.
>>>>>
>>>>> Alan
>>>>
>>>> And that's why I use `Find Any File'!
>>>
>>> Sure, but they're far from functionally equivalent, since Find Any
>>> File doesn't search on content. So if I don't know the name of
>>> something but I know what's inside it, I can't find it with that
>>> tool. Since that's my preferred searching method for many things,
>>> using Find Any File just adds a third tool for me, so it's really
>>> a last resort.
> But locate doesn't search content either, does it?
True (I guess I sound incoherent in what I want :-)) Basically I'd be
happy if locate could find stuff (albeit without content, but from the
command line) or spotlight could (with content, in the GUI). What I
don't really want is a third tool that's GUI but only finds names.
(Which is more or less what Find Any File is) since that for me is the
worst of both worlds. (And I understand that this is a very personal
opinion).
Alan
>
> Good luck,
> cfr
>>> Thanks
>>>
>>> Alan
>>>
>>
>> There is a way to get Spotlight functionality with access to system
>> and ~/Library/texmf files, using the Automator that came with Snow
>> Leopard. Create an application, drag "Find Finder Items" onto the
>> right hand panel, the select "Computer", "All" and "Any Content".
>> Then, under Options, check "Show this action when workflow runs".
>> Next, drag "Filter paragraphs" to the right panel, underneath "Find
>> Finder Items", and set it to Return paragraphs that do not end
>> with .emlx". After that, drag "Run Applescript" onto the right
>> panel under the two other items, and enter the following:
>>
>> on run {input, parameters}
>> set dq to ASCII character 34
>> set AppleScript's text item delimiters to ASCII character 10
>> set dat to input as text
>> tell application "Terminal"
>> activate
>> delay 1
>> do script ("echo " & dq & dat & dq) in window 1
>> end tell
>> end run
>>
>> Then save the application, say as myfind.app. You can set a hotkey
>> for it under System preferences/Keyboard. The end result is that
>> when you hit the hotkey, the Find Finder Items dialog will appear,
>> and after pressing Continue, you will see a list in a Terminal
>> window of all files containing the specified text.
>>
>> Michael
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex
>
--
Alan Munn
amunn at gmx.com
More information about the MacOSX-TeX
mailing list