image
image
Ticket Options
Question Details
TICKET ARCHIVE -> Script Editor & Firefox
motoman - Oct 2, 2005 - 10:39 am
image
image
Is it possible to use script editor to clear history and cache in firefox? thanks for your help

machine model: power mac g4
cpu type: powerpc g4 (3.3)
number of cpus: 1
cpu speed: 1.25 ghz
l2 cache (per cpu): 256 kb
l3 cache (per cpu): 1 mb
memory: 768 mb
bus speed: 167 mhz
boot rom version: 4.4.8f2

system version: mac os x 10.3.9 (7w98)
kernel version: darwin 7.9.0
bobw - Oct 2, 2005 - 11:08 am
image
image
Hi dan

sure, this should work for you;
===========================================

tell application "finder"
if (exists item "osx-60:users:bob:library:application support:firefoxrofiles:9qeq799z.default:cache") then
delete item "osx-60:users:bob:library:application support:firefoxrofiles:9qeq799z.default:cache"
end if


if (exists item "osx-60:users:bob:library:application support:firefoxrofiles:9qeq799z.default:history.dat") then
delete item "osx-60:users:bob:library:application support:firefoxrofiles:9qeq799z.default:history.dat"
end if

end tell
==================================================

change "osx-60" to the name of your hard drive

change "bob" to your user name

change "9qeq799z.default" to the name of that folder on your drive

--------

bobw - macosx.com tech support

motoman - Oct 3, 2005 - 9:16 am
image
image
Hi Bob,

Thanks for your quick response. I tried what you suggested and get a false in the event log.

this is what I used

tell application "finder"
if (exists item "macintosh hd:users:danielhawley:library:application support:firefoxrofiles:ralsk6l1.DAno:cache") then
delete item "macintosh hd:users:danielhawley:library:application support:firefoxrofiles:ralsk6l1.DAno:cache"
end if


if (exists item "macintosh hd:users:danielhawley:library:application support:firefoxrofiles:ralsk6l1.DAno:history.dat") then
delete item "macintosh hd:users:danielhawley:library:application support:firefoxrofiles:ralsk6l1.DAno:history.dat"
end if

end tell

this is what returns in the event log

tell application "Finder"
exists item "macintosh hd:users:danielhawley:library:application support:firefoxrofiles:ralsk6l1.DAno:cache"
false
exists item "macintosh hd:users:danielhawley:library:application support:firefoxrofiles:ralsk6l1.DAno:history.dat"
false
end tell

Any further suggestions? Thanks for the help, Dan
bobw - Oct 3, 2005 - 9:22 am
image
image
Dan

Open your hard drive in column view and open user>library>application support>firefox

Take a screen shot of that and email it too me at
bobw@macosx.com

I'd like to see the column of the Profiles - .defautl - and the column where the bookmarks etc are.
--------

Bobw - Macosx.com Tech Support

bobw - Oct 3, 2005 - 9:42 am
image
image
Dan

The folder named 'ralsk611.Dano - should be named 'xxxxx.default' or default.xxx or something like that.

Option copy that ralsk6l1 folder to the desktop. Then delete that folder from inside the Profiles folder. Keep that folder on the desktop for now, it has your Bookmarks in it.

Then open user>library>preferences and delete this file;

org.mozilla.firefox.plist

Now open Firefox. It will create another preference file, and should create a new default folder in the Profiles folder. Let me know what the name of that new folder is.
--------

Bobw - Macosx.com Tech Support

motoman - Oct 3, 2005 - 10:41 am
image
image
thanks Bob

it is named vkipyvu5.Default User
bobw - Oct 3, 2005 - 10:48 am
image
image
Dan

is the the actual name;

vkipyvu5.Default User

It has User after 'Default"?
--------

Bobw - Macosx.com Tech Support

motoman - Oct 3, 2005 - 10:57 am
image
image
yes it does say default user

thanks, Dan
bobw - Oct 3, 2005 - 11:06 am
image
image
Dan

Ok, chnage the name, just deleting the word user, so the name of that folder is 'vkipyvu5.Default'

Then try this script;

tell application "finder"

if (exists item "Macintosh HD:users:danielhawley:Library:Application Support:Firefox:Profiles:vkipyvu5.Default:cache") then
delete item "Macintosh HD:users:danielhawley:Library:Application Support:Firefox:Profiles:vkipyvu5.Default:cache"
end if


if (exists item "Macintosh HD:users:danielhawley:Library:Application Support:Firefox:Profiles:vkipyvu5.Default:history.dat") then
delete item "Macintosh HD:users:danielhawley:Library:Application Support:Firefox:Profiles:vkipyvu5.Default:history.dat"
end if

end tell
--------

Bobw - Macosx.com Tech Support

motoman - Oct 3, 2005 - 11:35 am
image
image
thanks Bob,

I think I have the script working properly now. At first I ended up with two profiles so I deleted them and created a new one with my name, then modified your script to reflect the name change. I ran several tests where the cache and history were cleared using the script.

so now I want to get my bookmarks back from the profile I saved on the desktop, do I just drag the bookmarks (and preferences) to the new profile?

thanks, Dan
bobw - Oct 3, 2005 - 11:39 am
image
image
Dan

Yes, just drag the bookmarks.html file to the new profile. Hold the Option key to make sure you still have the one on the Desktop. Once everything's ok, you can trash anything left over.
--------

Bobw - Macosx.com Tech Support

motoman - Oct 3, 2005 - 11:58 am
image
image
Thanks Bob

I was able to move my bookmarks. How do I move my auto fill forms? the passwords for things like ebay

I tried formhistory.dat unsuccessfully
bobw - Oct 3, 2005 - 12:00 pm
image
image
Dan

They may be in the Cookies files. Try moving them back.

You can move everything from the old folder back into the new folder.
--------

Bobw - Macosx.com Tech Support

motoman - Oct 3, 2005 - 12:42 pm
image
image
Bob

it was not the cookies but I moved everything and I am good to go with my auto fill forms.

one last thing

now every time I quit Firefox I get a new bookmarks file in my profile folder

bookmarks-1.html
bookmarks-2.html
bookmarks-3.html
bookmarks.bak
bookmarks.html
Cache

any idea why this is occurring or how to eliminate this

thanks, Dan
bobw - Oct 3, 2005 - 12:55 pm
image
image
Dan

I've only seen this happen with Tiger (10.4), being caused by indexing.

Are you sure you're running 10.3.9?
--------

Bobw - Macosx.com Tech Support

motoman - Oct 3, 2005 - 1:41 pm
image
image
Bob,

System Version: Mac OS X 10.3.9 (7W98)
Kernel Version: Darwin 7.9.0
Boot Volume: Macintosh HD

When I first contacted you about improving the performance of firefox (9/19) you taught me how to empty the cache. In this process (on 9/20) you had me eliminate all the bookmark files (81) that firefox had accumulated. Since then there were no additional bookmark files added.

Now that I created a new profile firefox is adding a bookmark file each time I quit. Since this I have quit 4 times and have 4 additional bookmark files. Do I need to do something with my profile? Do I need to run a utility program?

Thank you for all your help. I would not be able to do this alone. Dan
bobw - Oct 3, 2005 - 2:24 pm
image
image
Dan

using Disk Utility in your Utility folder, Repair Permissions.

If Firefox still creates more bookmarks files, check the permissions on both bookmarks.html and bookmarks.bak. Make sure they are Read & Write.
--------

Bobw - Macosx.com Tech Support

motoman - Oct 3, 2005 - 3:03 pm
image
image
Hi Bob

I repaired permissions using Disk Utility. I confirmed both bookmarks.html and bookmarks.bak are read and write. Still getting a new bookmark file when quitting Firefox. Rebooted and still the same issue.

So I ran DIsk Utility, repair permissions again and got the identical message as I did the first time I ran repair permissions. I am not sure I understand why. Message follows

Repairing permissions for “Macintosh HD”
Determining correct file permissions.
We are using special permissions for the file or directory ./Library/ColorSync/Profiles/Displays. New permissions are 16893
We are using special permissions for the file or directory ./Library/ColorSync/Profiles. New permissions are 16893
We are using special permissions for the file or directory ./System/Library/Filesystems/cd9660.fs/cd9660.util. New permissions are 33261
We are using a special uid for the file or directory ./private/var/at/jobs. New uid is 1
We are using a special uid for the file or directory ./private/var/at/spool. New uid is 1
The privileges have been verified or repaired on the selected volume

any more suggestions? again thanks for your patience and help, Dan

Permissions repair complete

bobw - Oct 3, 2005 - 3:10 pm
image
image
Dan

Move the Firefox Preference file (org.mozilla.firefox.plist) out to the desktop and open FF and see if this happens. Delete any duplicate bookmark files first.

If this doesn't help, I would download a new version of FF. Trash the FF app you now have, the Preference file again, move the Profile folder to the desktop, then trash the Firefox folder in Application Support.

Install the new version and set it up. Once done and working ok, move your bookmark file back into the Profile folder.

You'll also need to make a change in the script for the new name of the default folder if that changed.
--------

Bobw - Macosx.com Tech Support

motoman - Oct 3, 2005 - 3:24 pm
image
image
Bob,

I can not find org.mozilla.firefox.plist.

I looked in user/library/preferences

I searched with the finder.

Am I looking in the wrong spot? Thanks, Dan

bobw - Oct 3, 2005 - 3:28 pm
image
image
Dan

That's the correct name of the file - org.mozilla.firefox.plist

It should be in the Preference folder here;


user>library>Preferences

near the bottom
--------

Bobw - Macosx.com Tech Support

motoman - Oct 3, 2005 - 3:51 pm
image
image
Thanks Bob,

I used Grab to capture the window and emailed that to you. Still no luck.

Dan
bobw - Oct 3, 2005 - 3:57 pm
image
image
Dan

Got it

This is strange.

Look here;

Library>Preferences
--------

Bobw - Macosx.com Tech Support

motoman - Oct 3, 2005 - 7:31 pm
image
image
Bob,

Sent you a grab image of library/preferences. But it is not there either. Nor in system preferences.

Still adding a new numbered bookmark file each time I quit Firefox.

Thanks, Dan
bobw - Oct 4, 2005 - 9:30 am
image
image
Dan

Wish I had an answer for the Preference file. I have no idea why it's not there, but if Firefox is working okay, other than the duplicate bookmarks, then I wouldn't worry about it.

Duplicate bookmarks in Firefox is a known thing in Tiger (10.4) and caused by Firefox being indexed by Spotlight.

You could add to that previous script, to delete the;
bookmarks-1.html
bookmarks-2.html
bookmarks-3.html

add this just before 'end tell';
===============================================

if (exists item "Macintosh HD:users:danielhawley:Library:Application Support:Firefox:Profiles:vkipyvu5.Default:bookmarks-1.html") then
delete item "Macintosh HD:users:danielhawley:Library:Application Support:Firefox:Profiles:vkipyvu5.Default:bookmarks-1.html"
end if

if (exists item "Macintosh HD:users:danielhawley:Library:Application Support:Firefox:Profiles:vkipyvu5.Default:bookmarks-2.html") then
delete item "Macintosh HD:users:danielhawley:Library:Application Support:Firefox:Profiles:vkipyvu5.Default:bookmarks-2.html"
end if

if (exists item "Macintosh HD:users:danielhawley:Library:Application Support:Firefox:Profiles:vkipyvu5.Default:bookmarks-3.html") then
delete item "Macintosh HD:users:danielhawley:Library:Application Support:Firefox:Profiles:vkipyvu5.Default:bookmarks-3.html"
end if
===========================================

Not a great solution, but I've beenall over the web trying to find an answer to the dupes in 10.3 without sucess.
--------

Bobw - Macosx.com Tech Support

motoman - Oct 4, 2005 - 10:11 am
image
image
Bob

I wish to thank you again for all your efforts. This is a great service. I have added the delete bookmarks to my script and it works well. I have learned quite a bit during this process. I will continue to monitor the situation with the duplicate bookmarks and the still missing preference plst.

Firefox is working well, I am surprised at the size of the files I have been deleting using the script. No wonder FF bogged down before.

Thanks again, Dan
bobw - Oct 4, 2005 - 10:19 am
image
image
Dan

Browse Cache files grow very large if not emptied.

I use the script to empty both Firefox and Safari cache files.

I use the script to quit Safari, then it trashes the cache files;

tell application "Safari"
quit
end tell
--------

Bobw - Macosx.com Tech Support

motoman - Oct 4, 2005 - 10:42 am
image
image
Hi Bob,

I am using this script to clean up Safari. It was what got me thinking that a script to clean up FF would be nice.

Thanks again for all the help and education.

Dan

tell application "Safari" to quit
tell application "Finder"
set x to (path to current user folder) as text
set y to x & "Library:Caches:Safari" as text
set z to x & "Library:Safari:History.plist" as text
set zz to x & "Library:Preferences:
com.apple.quicktime.plugin.preferences.plist" as text
if (exists item y) then
delete item y
end if
if (exists item z) then
delete item z
end if
if (exists item zz) then
delete item zz
end if
empty trash
end tell
bobw - Oct 4, 2005 - 11:22 am
image
image
Dan

glad i could help.
--------

bobw - macosx.com tech support

IF THIS IS YOUR QUESTION AND YOU WISH TO RESPOND, LOGIN HERE FIRST.


Search Engine Friendly URLs by vBSEO 3.1.0