Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > OS X

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 26, 2008, 04:55 PM   #1
Mariux.mac
macrumors member
 
Join Date: Feb 2008
How to clear search history in sidebar?

does any one now how to clear the search history in sidebar?
Mariux.mac is offline   0 Reply With Quote
Old Apr 26, 2008, 04:57 PM   #2
mackindergarten
macrumors 6502
 
Join Date: Feb 2008
Hi,

I'd love to help you, but I don't know what you're talking about? Which browser are you using / do you have any plugins installed.

/Rupert
__________________
www.mackindergarten.com
Tutorials and How-Tos for Mac Starters
mackindergarten is offline   0 Reply With Quote
Old Apr 26, 2008, 05:00 PM   #3
Mariux.mac
Thread Starter
macrumors member
 
Join Date: Feb 2008
no not in broser in finder there are "search for" side bar
Mariux.mac is offline   0 Reply With Quote
Old Apr 26, 2008, 05:03 PM   #4
mackindergarten
macrumors 6502
 
Join Date: Feb 2008
Ah, alright...

watch out! These are not history items. These are Smart Folders showing actual content of your hard drive, used Today, Yesterday and so on.

DON'T delete them or you will run into serious trouble.

To remove the Smart Folders from the sidebar, just drag them off the sidebar and they will vanish in a puff of smoke.

/Rupert
__________________
www.mackindergarten.com
Tutorials and How-Tos for Mac Starters
mackindergarten is offline   0 Reply With Quote
Old Apr 26, 2008, 05:12 PM   #5
Mariux.mac
Thread Starter
macrumors member
 
Join Date: Feb 2008
when i got my MBP yestorday and whas testing what will happen if i delete search history of side bar i now one thing my system prederences stop working now i now that there are real files

whell i just testet like you sed to remove the icon. but in finder preferences you can again add the same for exemple "today" smart folder and the search history is the same.
__________________
MBP 15"\2.5Ghz\200GB-7200rpm\GF 8600M GT 512MB\Matte

Last edited by Mariux.mac; Apr 26, 2008 at 05:18 PM.
Mariux.mac is offline   0 Reply With Quote
Old Apr 26, 2008, 05:17 PM   #6
TuffLuffJimmy
macrumors G3
 
TuffLuffJimmy's Avatar
 
Join Date: Apr 2007
Location: Portland, OR
Time to put those disks that you got with your computer in your drive and reinstall everything.

Never ever delete anything on any computer unless you are sure you know what it is!
__________________
"Next PM I get from you about this, and it gets posted as my signature." --*LTD*
TuffLuffJimmy is offline   0 Reply With Quote
Old Apr 26, 2008, 05:25 PM   #7
Mariux.mac
Thread Starter
macrumors member
 
Join Date: Feb 2008
im new to the OS X system, i had 40 mhz, 20 ram, 250mb mac os 8 computer it whas super, ooo those duke nukem 3d times... ))
__________________
MBP 15"\2.5Ghz\200GB-7200rpm\GF 8600M GT 512MB\Matte
Mariux.mac is offline   0 Reply With Quote
Old Jan 19, 2010, 04:29 AM   #8
Ferry24
macrumors newbie
 
Join Date: Jan 2010
How to clear search history in sidebar?

Quote:
Originally Posted by Mariux.mac View Post
does any one now how to clear the search history in sidebar?
There is an ease way to solve this problem.
Open "Today" in sidebar - click Info
Then open "Today" folder using the path (shown in info where):
/System/Library/CoreServices/Finder.app/Contents/Resources/CannedSearches/Today.cannedSearch
To view the contents of the Finder.app, right click and click on "Show Package Contents" to see the content, then open the other folders.
Now you can delete the files of the "Today" folder but before is useful to empty the Trash. After deleting you MUST PUT BACK these files from "Trash" to recovery the deleted files (open Trash, then click "Put Back) because the files are real deleted from original location.
Ferry24 is offline   0 Reply With Quote
Old Jan 28, 2010, 10:11 AM   #9
Ferry24
macrumors newbie
 
Join Date: Jan 2010
How to clear the search history in sidebar

Open "Today" or "Yesterday" or "Past Week", select All and put in trash, then select All, and "Put Back" using right click menu. If "Put Back" is not visible (depend of kind of file ), select file by file or group of files. This method work also for search and Smart Folder. REMEMBER to "Put Back" to recover the files in the original position (the files are real deleted). In history are not recovered
Ferry24 is offline   0 Reply With Quote
Old Jan 28, 2010, 11:57 AM   #10
Denarius
macrumors 6502a
 
Denarius's Avatar
 
Join Date: Feb 2008
Location: Gironde, France
Quote:
Originally Posted by Ferry24 View Post
Open "Today" or "Yesterday" or "Past Week", select All and put in trash, then select All, and "Put Back" using right click menu. If "Put Back" is not visible (depend of kind of file ), select file by file or group of files. This method work also for search and Smart Folder. REMEMBER to "Put Back" to recover the files in the original position (the files are real deleted). In history are not recovered
This is really dangerous rubbish in my view. What you see as the Today/Yesterday/Last Week 'folder' are in fact smart queries looking at the document metadata in the filesystem and showing you the real files. If you delete them, they're gone. That's it, end of. On the other hand if you put them back where they belong they'll still have the same date in the file metadata and will still show up in the Today/Yesterday/Past Week searches.

The only way I can think of is to modify the datestamp within the document metadata, which must be possible as the system does that every time you open the file, but I suspect you need to be an experience OS X developer to make something that can do this.
__________________
-MacBook Pro 15" 2.2GHz Santa Rosa 4GB 320gb 7200rpm (slightly dented from having a shelf land on it and from a rather unfortunate tumble from the table)
-OS 10.5.8 (XBench score 134)
Denarius is offline   0 Reply With Quote
Old Jan 29, 2010, 07:03 AM   #11
Ferry24
macrumors newbie
 
Join Date: Jan 2010
Quote:
Originally Posted by Denarius View Post
This is really dangerous rubbish in my view. What you see as the Today/Yesterday/Last Week 'folder' are in fact smart queries looking at the document metadata in the filesystem and showing you the real files. If you delete them, they're gone. That's it, end of. On the other hand if you put them back where they belong they'll still have the same date in the file metadata and will still show up in the Today/Yesterday/Past Week searches.

The only way I can think of is to modify the datestamp within the document metadata, which must be possible as the system does that every time you open the file, but I suspect you need to be an experience OS X developer to make something that can do this.
I am sorry, mat this method works.Tray to see !!. Some time fail if the file is protected but I an not understand why. With the same kind of file, the same protection, one is cleared (from ,for instance, "Today") and the other not. I must to investigate
Ferry24 is offline   0 Reply With Quote
Old Jan 31, 2010, 05:20 PM   #12
Denarius
macrumors 6502a
 
Denarius's Avatar
 
Join Date: Feb 2008
Location: Gironde, France
Quote:
Originally Posted by Ferry24 View Post
I am sorry, mat this method works.Tray to see !!. Some time fail if the file is protected but I an not understand why. With the same kind of file, the same protection, one is cleared (from ,for instance, "Today") and the other not. I must to investigate
What version of OS X are you using? This definitely doesn't work on my system which is 10.5.8.

What does work is to copy the file to a Fat 32 volume, could be a USB flash drive, external hd, whatever. Then delete the original file from the trash, we'll call it filename and the external volume extfat32volume.
When the file goes from an HFS volume to a fat32 it has to store the file's metadata in a separate file called ._filname
Now, in terminal:
Code:
rm -rf "/Volumes/extfat32volume/._filename"
Finally, drag the file back to it's original location on your hard drive.

Reckon it'd be fairly straightforward to write an applescript to do this.
__________________
-MacBook Pro 15" 2.2GHz Santa Rosa 4GB 320gb 7200rpm (slightly dented from having a shelf land on it and from a rather unfortunate tumble from the table)
-OS 10.5.8 (XBench score 134)

Last edited by Denarius; Jan 31, 2010 at 05:20 PM. Reason: a
Denarius is offline   0 Reply With Quote
Old Jan 31, 2010, 08:14 PM   #13
Denarius
macrumors 6502a
 
Denarius's Avatar
 
Join Date: Feb 2008
Location: Gironde, France
Reliable solution using a FAT32 volume and an Applescript.

Here's an Applescript to do this with a FAT32 volume attached in order to split off the metadata.

Code:
set originalFile to choose file with prompt "Choose a document to clear from sidebar history:"
set originalPOSIXFilePath to POSIX path of originalFile
--Set the name of your FAT32 volume in the quotes on the next line
set otherDisk to "NO NAME"
tell application "Finder"
	set originalFilePath to container of originalFile as text
	copy file originalFile to disk otherDisk
end tell
set originalFileName to name of (info for originalFile)
set destinationFullPath to otherDisk & ":" & originalFileName
set destinationMDFullPath to otherDisk & ":._" & originalFileName
set copiedFile to alias destinationFullPath
set copiedFileMD to alias destinationMDFullPath
tell application "Finder"
	delete originalFile
	delete copiedFileMD
	copy file copiedFile to alias originalFilePath
	delete copiedFile
end tell
delay 0.5
--last part modifies the POSIX last access time to complete the job
do shell script "touch -a -t 200901010715 " & originalPOSIXFilePath
Probably one of the most useless things I've ever done, but interesting nevertheless.
__________________
-MacBook Pro 15" 2.2GHz Santa Rosa 4GB 320gb 7200rpm (slightly dented from having a shelf land on it and from a rather unfortunate tumble from the table)
-OS 10.5.8 (XBench score 134)
Denarius is offline   0 Reply With Quote
Old Feb 1, 2010, 10:55 AM   #14
Denarius
macrumors 6502a
 
Denarius's Avatar
 
Join Date: Feb 2008
Location: Gironde, France
Here's a rock solid solution exploiting the fact that gzip compression doesn't support OS X document metadata. the POSIX aTime is also changed for the sake of being thorough.

Code:
on hide_item(fileToProcess)
	set posixPath to POSIX path of fileToProcess
	do shell script "touch -a -t 200901010730 " & "'" & posixPath & "'"
	do shell script "gzip " & "'" & posixPath & "'"
	do shell script "gzip -d " & "'" & posixPath & ".gz'"
end hide_item

on run
	set anItem to choose file with prompt "Choose a document to clear from sidebar history:"
	hide_item(anItem)
end run

on open itemsToHide
	repeat with anItem in itemsToHide
		hide_item(anItem)
	end repeat
end open
Paste the into script editor, save it as file format Application bundle and drag it into the dock. You can run it either by clicking or by dragging the item(s) you wish to remove onto the icon in the dock.
__________________
-MacBook Pro 15" 2.2GHz Santa Rosa 4GB 320gb 7200rpm (slightly dented from having a shelf land on it and from a rather unfortunate tumble from the table)
-OS 10.5.8 (XBench score 134)

Last edited by Denarius; Feb 1, 2010 at 11:00 AM. Reason: Minor modification to code.
Denarius is offline   0 Reply With Quote
Old Feb 2, 2010, 05:01 AM   #15
Denarius
macrumors 6502a
 
Denarius's Avatar
 
Join Date: Feb 2008
Location: Gironde, France
This is a new version that uses ditto to strip the resource fork. Know issue is that it can't deal with directories correctly.

Code:
on hide_item(fileToProcess)
	set posixPath to replaceChar(POSIX path of fileToProcess, "\"", "\\\"")
	do shell script "touch -a -t 200901010730 " & "\"" & posixPath & "\""
	do shell script "ditto --norsrc \"" & posixPath & "\" tmpfile.jpg && mv tmpfile.jpg " & "\"" & posixPath & "\""
end hide_item

on replaceChar(theString, oldChar, newChar)
	set oldDelimiters to AppleScript's text item delimiters
	set AppleScript's text item delimiters to oldChar
	set theArray to every text item of theString
	set theNewString to ""
	repeat with i from 1 to length of theArray
		set stringPart to item i of theArray
		set theNewString to theNewString & stringPart
		if i is less than length of theArray then set theNewString to theNewString & newChar
	end repeat
	return theNewString
end replaceChar

on run
	set anItem to choose file with prompt "Choose a document to clear from sidebar history:" without invisibles
	hide_item(anItem)
end run

on open itemsToHide
	repeat with anItem in itemsToHide
		hide_item(anItem)
	end repeat
end open
__________________
-MacBook Pro 15" 2.2GHz Santa Rosa 4GB 320gb 7200rpm (slightly dented from having a shelf land on it and from a rather unfortunate tumble from the table)
-OS 10.5.8 (XBench score 134)
Denarius is offline   0 Reply With Quote
Old Feb 2, 2010, 08:44 AM   #16
Denarius
macrumors 6502a
 
Denarius's Avatar
 
Join Date: Feb 2008
Location: Gironde, France
Final version (I think).

After all this reading, the solution to the original problem posted by the OP was a resource fork stripper, which I have inadvertently reinvented. Oh well, here it is anyway. It now works on both files and directories, getting rid of the resource forks of all selected files or within the chosen directory. It seems to work quite well, but comments welcome!

Code:
--Main handler for the script.
on hideItem(pathAlias)
	--Get the path to use in the shell command from the alias of the file.
	set posixPath to POSIX path of pathAlias
	set quotedPosixPath to quoted form of posixPath
	--Checks that the path is to a file and not a directory and proceeds.
	if isPOSIXDirectoryPath(posixPath) is false then
		do shell script "touch -a -t 200901010730 " & quotedPosixPath & " && ditto --norsrc " & quotedPosixPath & " tmpfile.jpg && mv tmpfile.jpg " & quotedPosixPath
	else
		do shell script "touch -a -t 200901010730 " & quotedPosixPath & " && ditto --norsrc " & quotedPosixPath & " tmpfile && rm -rf " & quotedPosixPath & " && mv tmpfile " & quotedPosixPath
	end if
end hideItem

-- Checks whether the POSIX path given points to a directory or a file. True if directory.
on isPOSIXDirectoryPath(thePath)
	if last character of thePath is "/" then
		set theResult to true
	else
		set theResult to false
	end if
	return theResult
end isPOSIXDirectoryPath

-- Displays a prompt to select a file in the event that the script is double-clicked.
on run
	set anItem to choose file with prompt "Choose a document to clear from sidebar history:" without invisibles
	hideItem(anItem)
end run

-- Provides droplet functionality.
on open itemsToHide
	repeat with anItem in itemsToHide
		hideItem(anItem)
	end repeat
end open
__________________
-MacBook Pro 15" 2.2GHz Santa Rosa 4GB 320gb 7200rpm (slightly dented from having a shelf land on it and from a rather unfortunate tumble from the table)
-OS 10.5.8 (XBench score 134)

Last edited by Denarius; Feb 2, 2010 at 09:30 AM. Reason: Code modification.
Denarius is offline   0 Reply With Quote
Old Nov 27, 2010, 10:59 AM   #17
Nero Wolfe
macrumors regular
 
Join Date: Oct 2007
Location: Atlanta, GA
Send a message via AIM to Nero Wolfe
Another way to keep stuff out of there is to add whatever folders contain sensitive items (or whatever you don't want showing up) to the privacy list in Spotlight.
__________________
iMac 21.5" 2.5GHz i5
MacBook Pro 17" 2.2GHz i7
iPad mini 32GB
iPhone 6 Plus 64GB
Nero Wolfe is online now   0 Reply With Quote
Old May 26, 2011, 01:32 PM   #18
LovellStudios
macrumors newbie
 
Join Date: May 2011
That works Nero!

Using the spotlight and adding the folders to Privacy - removed all sensitive files from the search -- today, yesterday, etc!

Thanks!
LovellStudios is offline   0 Reply With Quote
Old May 30, 2012, 10:44 AM   #19
obie0174
macrumors newbie
 
Join Date: May 2012
Simply...

To clear history, you simply click 'History' tab at the top of your screen, click on it to open it, and at the bottom of the tab, there is an option to 'Clear History...' simply click that and there you go. Now for the sidebar, you click the little magnifying glass in the far left corner of the side bar, and just above your variety of different search engines you can use, there is an option to 'Clear Recent Searches' and presto, you've cleared your computer history and recent searches. Glad I could be of service. Any questions, comments, or concerns, ask away.
obie0174 is offline   -1 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
safari sidebar history ? anonymous4a OS X Mavericks (10.9) 0 Jan 8, 2014 02:02 AM
Adding Search to Sidebar dakrisht OS X 10.8 Mountain Lion 2 Aug 24, 2013 05:31 AM
Clear history bug? Tech198 Mac Applications and Mac App Store 1 Feb 6, 2013 08:33 PM
Safari 6: Clear History also clear all favicons Crispy Duck Mac Applications and Mac App Store 0 Aug 1, 2012 04:03 PM
Safari STILL doesn't have clear history on exit? imahawki OS X 10.8 Mountain Lion 0 Jul 27, 2012 07:04 AM

Forum Jump

All times are GMT -5. The time now is 03:33 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC