Re: Spotlight and /Volumes



On 2005-11-28 11:36:33 +0100, J Stewart <cfnzrpu@xxxxxxxxxxx> said:


That could be accomplished easily with a shell script or an Applescript. Here's one I did that checks the status of one, some or all connected drives. This could be easily modded to turn Spotlight on or off. If you contact me offlist I'll see about doing it. Note: this script as written requires Mac OS X 10.4 or later.

Watch out for line wrap.

--> cut <--
set targ to choose from list (get list disks) with multiple selections
allowed -- wrapped
if targ is false then error number -128
set pw to text returned of (display dialog "Enter your Admin password:"
default answer "" with hidden answer) -- wrapped
set stats to {}
set scpt to "mdutil -s /volumes/"
repeat with aDisk in targ
   set temp to quoted form of contents of aDisk
   set end of stats to {do shell script scpt & temp password pw with
administrator privileges} -- wrapped
end repeat

set pw to ""
set newline to ASCII character 10
set temp to ""

repeat with x from 1 to count of stats
   set temp to temp & item x of stats & newline
end repeat

tell application "TextEdit"
   activate
   set doc to make new document
   set text of doc to temp
end tell
--> cut <--



Thanks! I tweaked it and it's ok (watch out the /volumes/ because it's /Volumes/, I use case sensitive FSs).


Thank you! I'll seek the next version of osx also :)


-- Sensei <senseiwa@xxxxxxx>

Part of the inhumanity of the computer is that, once it is competently programmed and working smoothly, it is completely honest. (Isaac Asimov)

.



Relevant Pages

  • Re: Spotlight and /Volumes
    ... set targ to choose from list with multiple selections ... set stats to ... repeat with aDisk in targ ... set temp to quoted form of contents of aDisk ...
    (comp.sys.mac.system)
  • Re: Monster of a formula!!
    ... The first three columns repeat themselves in the last three. ... Dim FirstAdr As String ... Dim i As Long, temp As Long ... CkID = "Good" ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Select question
    ... I don't have presentation layer at all. ... creating view is always the best solution when you have to repeat the ... derived table or is it faster to repeat the subquery? ... > Other alternatives would involve temp tables, ...
    (microsoft.public.sqlserver.programming)
  • Re: Fwd: HELP! Upgrade to V10
    ... migration guide and have updated stats. ... Mbs), the migration guide didn't mention synonyms specifically, any ... do you use temp tables? ...
    (comp.databases.informix)
  • Re: PING BERTIE DOE about the Isomac Venus
    ... I got a temp that maxed at 180F using an electronic ... and my Venus is only heating ... Just rethinking this, 180 in the cup is maybe 200 in the boiler, there will ... You'll see the button stats mounted on top of the boiler. ...
    (alt.coffee)

Loading