I found a good tip on speeding up Firefox here, using the Terminal to vacuum the sqlite databases. The commands as given on the page are:
for f in ~/Library/Application\ Support/Firefox/Profiles//.sqlite; do sqlite3 “$f” ‘VACUUM;’; done
or
cd ~/Library/Application\ Support/Firefox/Profiles/ for f in /.sqlite; do sqlite3 $f ‘VACUUM;’; done
So I thought I’d put it in an Applescript which I could just double click and run. So far I have:
display dialog "Vacuum Firefox SQLite Database?" buttons {"Cancel", "OK"} default button 2
if the button returned of the result is "OK" then
do shell script "cd ~/Library/Application\\ Support/Firefox/Profiles/ for f in */*.sqlite; do sqlite3 $f 'VACUUM;'; done"
end if
However I’m getting an error:
“sh: -c: line 0: syntax error near unexpected token do' sh: -c: line 0:
cd ~/Library/Application\ Support/Firefox/Profiles/ for f in /.sqlite; do sqlite3 $f ‘VACUUM;’; done’”
If I use the other Terminal command under do shell script I get the error “SQL error: near “Support”: syntax error” repeated a few times. The code I’m using for that is:
display dialog "Vacuum Firefox SQLite Database?" buttons {"Cancel", "OK"} default button 2
if the button returned of the result is "OK" then
do shell script "for f in ~/Library/Application\\ Support/Firefox/Profiles/*/*.sqlite; do sqlite3 $f 'VACUUM;'; done"
end if
I’m a total novice at Applescripting or any scripting for that matter, but I think it’s to do with the space between Application Support coupled with the “for f” command. I thought a double escape would fix that but I’m clearly missing something here.
Any help is most welcome.
Thanks.