Need script to delete two MS pref files

As one who can't script my way out of a paper bag, I come here suitably humbled to request help with a script. 
Every so often, some of my incoming emails in MS Entourage become unreadable due to garbled fonts.  The solution is two quit MS Entourage and delete two Microsoft preferences files.  I'm looking for a script that would automatically send these two files to the Trash:
• MS Office font cache
/Users/ramoncastaneda/Library/Preferences/Microsoft/Office Font Cache (11)  ===>>> delete the “Office Font Cache (11)” file.
• and MS browser font cache
/Users/ramoncastaneda/Library/Caches/com.microsoft.browserfont.cache ===>>> delete the "com.microsoft.browserfont.cache" file.
Thanks in advance for any and all guidance.

I would strongly recommend becoming more familiar with and more comfortable within Terminal and the command line environment, and preferably sooner rather than later; before you need it.
The cmmand line environment is the native environment of Mac OS X and Mac OS X Server, and it is the core of how the server operates, and the command line is particularly central to troubleshoot Mac OS X and Mac OS X Server if (when) something goes wrong, and it is how you will configure Mac OS X and Mac OS X Server for many of its more advanced operations and features.
Bash is the name of one of the command interpreters on Mac OS X and Mac OS X Server.  It is the default command interpreter for the command line environment; what's known as the shell or command shell or command line.
The command line is also where you can write bash shell scripts, such as the two delete commands that I posted.  A shell script is a file containing command line shell commands.  That three-line shell script is a bash script flag (the so-called "shebang") and the two rm remove commands that delete the two files.
The pico tool mentioned is a text editor, and an editor with a screen-driven command interface.  That particular pico command puts you into the pico text editor for the specified filename, and where you will have command hints for the editor visible at the bottom of the display.  There are more advanced editors than pico, but pico is a good editor to start with.
Again; I'd recommend becoming a little more comfortable with the command line; that'll pay dividends far beyond deleting a couple of cache files.

Similar Messages

  • Need script that delete objects of certain color...

    Hello. For my Hobby I would need an Illustrator script that can delete objects of a certain color on selected layer. The color can be set in a dialog like #000000 or anything alike.
    I will need it to delete letters in text that has a certain color (different than letters around it). Letters to delete can be inside sentances or free. It doesn't matter if the text need to be outlined and ungrouped before run script, or not.
    I would apprechiate any help. Thank you.

    // CharacterColorizedIfNotMatchPrompt.jsx
    // Hint: test the script with little text.
    // The more extensive the text, the more time it takes the script.
    // greetings pixxxel schubser
    // http://forums.adobe.com/thread/1190610?tstart=0
    var aDoc  = app.activeDocument;
    var col = new CMYKColor();
    col.cyan = 0;
    col.magenta = 20;
    col.yellow = 0;
    col.black = 0;
    var aTFrame = aDoc.textFrames;
    if (aTFrame.length > 0) {
        var check = prompt ("Which character?", "a");
        check1 = check;
        check2 = check1.toUpperCase();
        for (i=0; i<aTFrame.length; i++) {
            for (j=0; j<aTFrame[i].characters.length; j++) {
                aChar = aTFrame[i].characters[j];
                if (aChar.contents != check1 && aChar.contents != check2) {
                    aChar.fillColor = col;
    alert("done")
    Try this.
    Have fun.

  • Need Script to split multi-paged ID file into multiple single paged ID files

    I have created a 366 page document (and have 2 more to create). None of the text threads from page to page, and there are no master page items. Each page is destined to be used as a single block that will be copied and pasted into a master document by a database driven plugin (and for color editing reasons it needs to be separate .indd files). For expediency, I created these as a single document because I could import the text with ID style tags to pre-format the text (with all text blocks threaded). I then broke all the text threads using API's Auto Unstich plugin. We then manually tweaked the text of each page.
    Gluon once sold a plugin called DocSplitter, but it has not been updated since CS1 and does not work with CS4.
    Before you ask why I don't have the database plugin create multiple single page docs — the plugin doesn't currently save to individual ID docs (yet - feature to be released in 3 months).
    I know that scripting could possibly do what I need, but I have little to no experience with AppleScript (7 years ago) and none with Javascript. Would love to find a pre-packaged solution and am willing to pay someone for it.
    To guess there are two ways a script could work:
    1) script breaks the doc into single pages (not sure how that would work really) but the files would be named based on page number — i.e filename-01.indd, filename-02.indd, etc.
    2) script selects all objects on a page, groups the objects, copies the objects, creates a new page, pastes the objects and then saves the file in the same manner as number 1 above - loop and repeat for al the pages.
    Any help would be greatly appreciated.
    many thanks
    Roger

    Hi Roger,
    This topic was discussed in this thread: http://forums.adobe.com/message/1113562#1113562
    Check out this script:
    http://creative.mediabox.fr/index.php?app=core&module=attach&section=attach&attach_id=6440
    Kasyan

  • Cannot delete two stubborn video files

    Hello all,
    I have two files that I have downloaded by accident from a p2p site. They are both .mkv files, which I believe makes them Matroska video files. They are trailers for movies. They appear to work fine in VLC, but when I delete them and empty the Trash they appear back in the downloads folder a couple of hours later. I have tried 'shredding' them using a shredding Dashboard widget, but they won't disappear from my downloads folder (at least, they go and then come back). My p2p program is Vuze (formerly Azureus). I have checked permissions, and I have read and write privileges. Can anyone help me get rid of these files?
    I am not amazingly adept at computer stuff, so if there's anything technical involved I'd appreciate a step-by-step guide.
    Thanks so much!
    Leigh

    Try this
    In a terminal, enter
    rm
    be sure to include a space after rm
    then take one of the video files you wish to trash and drag it into the terminal next to the
    rm
    you should then see something like
    rm /Users/nero/Desktop/test.txt
    where Desktop will be, on your machine, the folder the file is in, and
    test.txt
    will be the name of the video file.
    Once it looks correct, hit the enter key and it should be gone for good.

  • Need To Urgently Delete Contents of a File! Please

    I have flat File that exist in a Directory. I check what its contents is and then I have to overwrite this File. But unfortunately I can't figure out how to overwrite what is alrady on the File. i just seem to add onto the contents.
    File f = new File("path" + "filename");
    //I need to check if it exist, so that I can decide whether I want to
    //create a New File, Modify the File or Pend the File
    //I can Pend and I can create a File, but not MOD
    f.exists();
    RandomAccessFile random = new RandomAccessFile(f, "rw");
    //As far as I understand the following command deletes the File
    //and returns a boolean the verify whether is has deleted the File or not.
    //But it always returns false
    f.delete();
    random.writeBytes("StringofBytes");If any of can see what I'm doing wrong. Please help me I got a time limit on this one.

    "f.delete()" always fails because the file is open. And that's because you yourself opened it in the previous line. First delete f, then create a new version of it.

  • Restore Prefs files with batch file CS5

    I'm running PS CS5 under Windows XP and ran into a "Refine Edge" problem where I couldn't get a functioning cursor. Checking around I came up with the solution of deleting & resetting my prefs file, which solved the problem. However restoring my prefs was time consuming and I thought there should be a better way where I could keep a backup prefs file & perform the restore with a batch file.  So if anyone is interested here is the procedure and sample batch file I set up.
    First in Win XP the prefs file(s) are buried in:
    C:\ Documents and Settings\User Name\Application Data\Adobe\Adobe Photoshop CS5\Adobe Photoshop CS5 Settings\
    and there were three prefs files that were affected when I deleted with the startup Ctrl/Alt/Shift procedure.
    They were:
    Adobe Photoshop CS5 Prefs.psp
    Palette.psp
    Color Settings.csf
    I made copies of each with an extension of .org (to signify original) - so there were three duplicate files in the directory.  There would be my backup files and are named:
    Adobe Photoshop CS5 Prefs.org
    Palette.org
    Color Settings.org
    Then I created a batch file named RestorePrefs.bat in the same directory as follows:
    Copy C:\Documents" "and" "Settings\User" "Name\Application" "Data\Adobe\Adobe" "Photoshop" "CS5\Adobe" "Photoshop" "CS5" "Settings\Adobe" "Photoshop" "CS5" "Prefs.org *.psp
    Copy C:\Documents" "and" "Settings\User" "Name\Application" "Data\Adobe\Adobe" "Photoshop" "CS5\Adobe" "Photoshop" "CS5" "Settings\Actions" "Palette.org *.psp
    Copy C:\Documents" "and" "Settings\User" "Name\Application" "Data\Adobe\Adobe" "Photoshop" "CS5\Adobe" "Photoshop" "CS5" "Settings\Color" "Settings.org *.csf
    The batch file copies the org (backup) files to the prefs files.
    Note There are no spaces in batch file. These are linked with quotes. 
    Then create an icon on the desktop that runs the batch file in the prefs directory.
    To check if its working properly prior to and without changing the prefs files, edit the batch file from *.psp & *.csf to *.XXX - run it  - then check the directory for three new files with the XXX extension.  If running OK, delete the XXX files and change the batch file back as above & your set to go.
    Burt Stuttman

    There are more files then the three that you noted that can can become corrupt in your user id Photoshop Preferences. Some preference files are not static some files are updated when you make changes to you Photoshop environment like edit action make brushes, patterns, define shapes  etc. Some preference files are updated every time you close down Photoshop.   I find it best to back up your whole user id Adobe Applications version Preference tree when the application is working well as a backup in case thing go sour.   Its really not a complex or time consuming process. It actually a very simple easy process you can do in windows file explorer right panel.
    Step one make your backup.   Highlight the preference folder right click click copy.  Then right click and click on paste "Folder name Copy" is the name of the copy and is your Backup.
    Should Photoshop mess up. Close Photoshop.  In file explorer do step 2 recover.
    Step 2 Highlight the preference folder right click  click on rename add a suffix Rotten "Folder name Rotten".   Highlight the preference folder "Folder name Copy" rename to "Folder name"
    Do step one create a new backup.
    Start Photoshop If all is well and you do not need to recover newer thing from  "Folder name Rotten" delete  "Folder name Rotten" after a few daye.   and your more sure everything is A OK.

  • Spotlight and pref files and trash

    In Tiger, serchin' with spotlight, results including files in trash, in preferences folder etc., and these is usefull to deleting application (with prefs, files in application support etc.).
    In Leopard, spotlight find only the application and nothing else, no prefs, no .dmg trashed in advance, nothing else.
    What do i have to do to have back an usefull spotlight?
    Thanks in advance

    Use CMD+F, click Kind, select System Files, click don't include button, and select include. Put a search term in. Save the search and use it any time you want to search everywhere. Alternatively, customize it and you can use it to replace the default_smart.plist buried in the Finder.app for all your searches. See http://www.macosxhints.com/article.php?story=20050501162147222 for the details.

  • Need a script to delete user files and run on logout.

    Hi folks!
    I'm a total Mac novice so forgive me if I'm vague on anything here. I work in a library and we have recently acquired an iMac running Mountain Lion. The unit is primarily for use by Visually Impaired users however sighted folks can use it as well.
    What I need is something that will delete any files created/downloaded by the sighted users but that will not delete anyone else's files. I tried just using the Guest Account however that also deletes all the system preferences for that account including the dock setup which I need to stay the same.
    If possible I would like this to run on logout.
    For additional points anyone who can also find me something that will run automatically when the users sign in and will sign them out after 30 minutes would super spectacularly awesome.
    Thanks people!

    That being said, if you you still really want to do this you can create a logout hook and write a shell script to remove the files.  See "About Daemons and Services", Appendix B on writing a logout hook.
    But a far easier way is to create Account's login item that will cause a shell script to be launched to delete the files.  You can encapsulate the shell script so it runs as an application that can be added to the Login Items.  One such encapsulator is Platypus.
    Note, rather than delete them, if you want to ensure all the specific plists have specific settings, then create a master set of them and copy the master set into the Preferences directory (being careful to observe ownership and permissions settings of course).

  • Need a script to delete files

    Hi
    Can someone advise me on how to create a script to delete certain files from a users home account at logout?
    The files that I want deleting are .plist files in there ~/lib.../preferences folder, this is so I can ensure that all users will have the same settings for certain files next time they login again.
    Thanks

    That being said, if you you still really want to do this you can create a logout hook and write a shell script to remove the files.  See "About Daemons and Services", Appendix B on writing a logout hook.
    But a far easier way is to create Account's login item that will cause a shell script to be launched to delete the files.  You can encapsulate the shell script so it runs as an application that can be added to the Login Items.  One such encapsulator is Platypus.
    Note, rather than delete them, if you want to ensure all the specific plists have specific settings, then create a master set of them and copy the master set into the Preferences directory (being careful to observe ownership and permissions settings of course).

  • Need script to check for duplicate file names when copying a folder

    Hello,
    I am a new applescript user trying to write what I believe should be a simple script. I was planning on using the "add-new item alert" script as a template.
    Basically I have people copying folders of photos into a library folder, but I don't want the Finder to copy the photo if it already exists in the library. The images in the library are organized into subfolders.
    I need a script that will check all the file names in the new folder against all the file names in the library, and NOT add the new one if it already exists.
    If anyone can help it would be greatly appreciated,
    Thanks,
    C

    I have a script that "kind of" works. The only problem I've seen is that it gets confused when filenames contain characters that are fine in Macland but not good in Unixland. Forward slashes are a good example of this.
    In this case I have a folder in my home named "copytest" Inside copytest are two folders:
    Source (containing the images to be added)
    Dest (My existing library of images)
    It also assumes that the folder of images to be added contains no sub-folders. Hope this helps.
    tell application "Finder"
    set theSource to folder "source" of folder "copytest" of home
    set imagesToBeCopied to name of every file of theSource
    end tell
    repeat with theFile in imagesToBeCopied
    try
    if (do shell script "find -r ~/copytest/dest -name " & quoted form of (theFile as string)) is not equal to "" then
    --The file exists. Don't copy it
    else
    --the file doesn't already exist. Copy it.
    end if
    on error
    return "Failed while trying to check for existence of a file"
    end try
    end repeat

  • HT1923 In trying to delete the Apple file in the Program/Common File I can delete all contents except the Internet Services folder.  Thus preventing me from deleting the Apple FIle.  Error message says I need permission to delete this file.  How do I proc

    Trying to delete the Apple Folder from Program Files/Common Files.  I can delete all the contents except for the Internet Services folder which prevents me from making the deletion.  The error message says "you need permission to delete this file".
    Discovered this problem when trying to upgrade from my 3G iPhone to a new 5S iPhone unsucessfully.

    See note 3 of Troubleshooting issues with iTunes for Windows updates.
    tt2

  • How can I delete the photos or files in my iCloud storage that is no longer needed?

    How can I delete the photos or files in my icloud storage that is no longer needed?

    Explain how it didn't work and what you are trying to delete.  Since icloud doesn't store photos except for those in a backup (then delete the backup); photos in photo stream do not count towards your storage limit.

  • How can I delete two .jpg files from my desktop that refuse to be deleted?

    How can I delete two .jpg files from my desktop that refuse to be deleted?

    The two icons refused to be moved to the garbage. The good part in all this is that ater I turned off the computer at night and turned it back on the next morning they were gone!
    Thanks.

  • I deleted all my iTunes files and need help recreating them.

    Hello everyone
    I accidentlly deleted all the iTunes files (NOT the content, just the files iTunes uses in its database). When I tried to create a new database, iTunes moved all my my music videos into the Movies or Home videos, which I don't want. I have a copy of my folder set up that I want iTunes to use and to not alter (exactly as it was before I deleted the files). Here is what I thought I need to do. Please corect me if I am wrong:
    1. remove all the files that iTunes has relocated to different folders (IE, basically delete them all)
    2. copy the folders onto the drive I use for my media
    3. start itunes
    4 unselect Keep my files organized
    5. scan the folders
    6. Select all the music and videos and classify them as "Music" or "Music Videos"
    This should keep all the files in the same folders as the backup copy, without moving them to Videos or Home Videos. I assume this will also retain the current Artist / Album / Song hierarchy.
    Is this correct?
    Any better way to do this?
    Thanks everyone who can help!
    JoHN

    1) If you bought them from Apple you canprobably download them again.
    2) If you back up your computer as you should, they will be on the backup.
    3) If you stop using your computer this instant (because as you use the computer it overwrites deleted files even if you have lots of space), buy recovery software ($100+), there is a  chance you can recover some of them, though they may have lost filenames and will be in quite a mess.

  • My memory is full of "other" what files need to be deleted to free up more memory?

    My memory is full of "other" what files need to be deleted to free up more memory?

    https://discussions.apple.com/docs/DOC-5142
    MacBook Pro (15-inch Mid 2012), OS X Mavericks (10.9), i7 500GB 16GB RAM iPhone5 iOS7.0.4

Maybe you are looking for