Need automator or applescript to change a setting in Safari with a keypress

I'm new to applescripting and automator, so bear with me. I found a .css file that stops annoying ads, flash ads, etc in Safari. It's great and makes the pages load faster and clean. And to implement it, you just have to click on "preferences" (in Safari), then "advanced" and enable or disable custom style sheets. I know from experience with Omniweb and Camino that sometimes when you block all flash and ads that some webpages don't load correctly. Some guys say they just keep two browsers running and when the one that loads clean doesn't bring up things they want, they just open the standard browser and reload the page. That's a lot of work. It would be easier to change the advanced preferences in Safari to either run the .css file or not with the press of a key. Does anyone have a clue how to make, say an Fkey to toggle, or two Fkeys (one turns on style sheet and one turns off) to do this task? Thanks for any help.

I'm new to applescripting and automator, so bear with me. I found a .css file that stops annoying ads, flash ads, etc in Safari. It's great and makes the pages load faster and clean. And to implement it, you just have to click on "preferences" (in Safari), then "advanced" and enable or disable custom style sheets. I know from experience with Omniweb and Camino that sometimes when you block all flash and ads that some webpages don't load correctly. Some guys say they just keep two browsers running and when the one that loads clean doesn't bring up things they want, they just open the standard browser and reload the page. That's a lot of work. It would be easier to change the advanced preferences in Safari to either run the .css file or not with the press of a key. Does anyone have a clue how to make, say an Fkey to toggle, or two Fkeys (one turns on style sheet and one turns off) to do this task? Thanks for any help.

Similar Messages

  • Applescript to change color of path items with specific swatch from swatch group, multiple times

    I am attempting to take a path item that is on its own layer and change its color multiple times, saving it each time.
    I was able to do it with javascript however can't get it to work in applescript.
    Javascript:
    (Items are already selected that I intend to change.)
    var iL = app.activeDocument.pathItems.length;
    var colorSwatches = app.activeDocument.swatchGroups.getByName('newColors');
    var allColors = colorSwatches.getAllSwatches();
    var colorNames = Array();
    for (var i = 0; i < allColors.length; i++){
        colorNames.push(allColors[i].name);
    for (x = 0; x<colorNames.length; x++)
            var currentColor = allColors[x].name;
            for (i=0; i<iL; i++)
                var myItem = app.activeDocument.pathItems[i];
                if(myItem.selected)
                    myItem.fillColor = app.activeDocument.swatches.getByName(currentColor).color;
    (I then go on to save each one)
    When trying to cross over into applescript I have the following so far:
                   set iL to count every path item of document 1
                   set colorSwatches to swatchgroup "newColors" of current document
                   set allColors to get all swatches colorSwatches
                   set swatchCount to count every item in allColors
                   repeat with i from 1 to swatchCount
                        set currentSwatch to item i of allColors
                        repeat with x from 1 to iL
                            set myItem to path item i of document 1
                   here is where I have no idea what I am doing... I can't figure out how to test if an item is selected
                            if myItem's has selected artwork is equal to true then
                                set fill color of myItem to {swatch:currentSwatch}
                            end if
                        end repeat
                   end repeat
    Or better yet is there a way I can select every path item of a layer and change its color that way?
    Something like the following:
              set fill color of every path item of layer "art" of document 1 to {swatch:currentSwatch}
    Thanks for any input!

    I'm throwing it into a Applescript OBJc project I am working with. I currently have it in a javascript file within the actual project however this is the slowest part of my project and I'm going to attempt to speed it up some.
    Let's say I'm changing the color of a path item 35 times... this starts to eat a ton of time up.
    My applescript save illustrator file as jpeg is much faster than the javascript one for some reason...
    It's also something I have needed to do numerous times in the past and never got around to asking.

  • Change printer setting to colour with activeX

    Hi
    I have an odd problem. 
    I create a report in excel with in LV. The I'd like to have it printed. But the printer settings are set to gray on default. 
    How can I set the printer settings to colour before printing?
    Thanks for any help.
    Yves

    In this way you really work in Excel through the ActiveX interface. So you will have to try to find an ActiveX interface in Excel that allows to do printer settings. There seems to be something promising when going from _Application.Active Dialog.Page Setup.Black and White. But how that all works I'm not sure.
    Something like this should probably work. It's untested but should get you into the right direction.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • I need applescript to change all files in a folder and its subfolders ending in .xlsx changed to .xlsb

    I need applescript to change all files in a folder and its subfolders ending in .xlsx changed to .xlsb

    try something like this:
    with timeout of 3600 seconds
      -- long timeout to because the Finder is horribly slow
              tell application "Finder"
      -- collects the files from a folder called "whatever" in your user home folder
                        set xlsbFiles to every file of entire contents of folder "Whatever" of home whose name extension is "xlsb"
                        repeat with thisFile in xlsbFiles
                                  set name extension of thisFile to "xlsx"
                        end repeat
              end tell
    end timeout
    you could make a more efficient script using System Events.app, but this will get the job done with a minimum of thought.

  • Set Mail Signature with Run AppleScript Action inside an Automator workflow

    Hello,
    Not sure if I am posting this at the right spot, but I would need some assistance. I am trying to write an Automator Workflow application. The purpose for this application is to:
    1. Drag one or more attachments on the application/droplet icon
    2. Automator workflow creates a new mail message in Mail with the attached items already addressed and ready to go to
    I setup the following Workflow inside Automator:
    1. New Mail Message
    2. Add Attachments to Front Message
    So this is all working just fine. Now I would like to add a step in between of type "Run AppleScript". In this "Run AppleScript" action I have the following code:
    on run {input, parameters}
    tell application "Mail"
    set the message signature of input to signature "My Signature Name"
    end tell
    return input
    end run
    So my workflow looks now like this:
    1. New Mail Message
    2. Run AppleScript
    3. Add Attachments to Front Message
    I am getting the following error:
    Can’t make «class situ» "My Signature Name" of application "Mail" into the expected type.
    So, in essence I am trying to select a signature for that particular new mail message in this workflow. And that does not work. Any help would be appreciated.
    Martin

    first, you don't need the extra action to add attachments. if you drop some items on the saved application they will be passed to the "new Mail message" action as input and will be added as attachments. also, in my testing it seems that the processes of attaching the attachments seem to bump against the process of adding the signature. it get the same result as you originally but if I add a delay to the run applescript action then it works as it should so try
    1. new mail message.
    2. run applescript
    on run {input, parameters}
    delay 1
    tell application "Mail"
    set the message signature of (item 1 of input) to signature "My Signature Name"
    end tell
    return input
    end run

  • I have the iPhone 4. I recently switched from PC to IMac. I am trying to sync my iPhone, but iTunes will not let me add or remove anything. Do I need to change a setting since I changed computers? Help!

    I have the iPhone 4. I recently switched from PC to IMac. I am trying to sync my iPhone, but iTunes will not let me add or remove anything. Do I need to change a setting since I changed computers? I try to add songs from my music into my phone section and it will not go... Plus the playlists on my phone are not updated on my iTunes phone on my computer. Its like it never updated. What am I doing wrong??

    Iphone will sync with one computer at a time.
    When you sync to another it will delete the current content.
    Make sure you have copied everything from your old computer to your new one first.

  • My company set up a Icloud account under their help desk email but i dont have the password to fix it so i need to be able to change the Icloud apple id to my email address but it wont let me because found my Ipad is turned on and cant change?

    My company set up an Icloud apple id under their help desk email by mistake and there isnt a password so how do i change the email address/apple id
    to my email address that i do have the password for?  I can use the Ipad for everything except the Icloud account.

    If you mean that Find My Phone is asking for a password to a different Apple ID to your current Apple ID and that ID is a previous version of your current ID, not an entirely different one.
    This feature has been introduced to make stolen phones useless to those that have stolen them.
    However it can also arise when the user has changed their Apple ID details with Apple and not made the same changes to their iCloud account/Find My Phone on their device before upgrading to iOS 7, or if you restore from a previous back up made before you changed your details and some other circumstances.
    The only solution is to change your Apple ID back to its previous state with Apple at My Apple ID using your current password, you don’t need access to this address if it’s previously been used with your Apple ID, once you have saved these details enter the password as requested on your device and then turn off "find my phone" and delete the account from your device. It may take a short while to remove the account.
    You should then change your Apple ID back to its current state, save it once again and then log back in using your current Apple ID. Finally, turn "find my phone" back on once again.
    This article provides more information about Activation Lock.
    This is answer is provided from my own database of boilerplate responses and the content was last reviewed and tested on: 2014/05/23

  • HT1689 I need to get my iPod to no longer be associated with the original i store account. My husband set it up through his account but now I have my own account. I don't want to go through his every time I want to make a change. how do I make this change

    I need to get my iPod to no longer be associated with the original i store account. My husband set it up through his account but now I have my own account. I don't want to go through his every time I want to make a change. how do I make this change?

    I am trying to stop using my I-pod under my husband's I-Tune account.  It was set up under his account and the only way I can use it under my account is to erase all of the songs my husband loaded on for me.  I had heard there is a duration that I-Pods are locked into to one account only, and I am trying to discover how I can use my account without having to erase everything on the I-Pod.  I know it sounds confusing but that's the way I-tunes have set it up.  thanks for asking.

  • Question about email setting: how  do i change the setting so i need to login to check my email. Currently it automatically come to the inbox without the need to log in. Thanks

    Question about email setting: how  do i change the setting so i need to login to check my email. Currently it automatically come to the inbox without the need to log in.

    You don't. Email comes in either by push or when you invoke the email app. Ther is no password except when you first set up the account. If your iPad is not being used as your personal device and you need to shield emails from other users, then don't use the email app.  Instead, use web mail if available from your provider.

  • I accidentally changed a setting on my ipod touch and now it won't change back. I have had my ipod for more than two years and i dont know what to do. If i go to the apple store, would they fix it, or would i need to get a new one?

    I accidentally changed a setting on my ipod touch and now it won't change back. I have had my ipod for more than two years and i dont know what to do. If i go to the apple store, would they fix it, or would i need to get a new one? If it could be fixed, how much would it cost?

    If it is still under warranty you can call the 800 number to apple and enter the serial number and it will tell you if it is under warranty or not if not its like $30 basically for them to help or something like that it said today when i called...
    Or take it to a genius bar if you have one near?
    Or further explain what setting you are needing fixed back and im sure someone here can help you for free!

  • I cannot get my e-mail to automatically enter addresses in the "TO:" box. In the past, I would get a list of e-mail recipients to appear when I typed 1 letter. That function no longer works. Do I need to change a setting or what?

    I cannot get my e-mail to automatically enter addresses in the "TO:" box. In the past, I would get a list of e-mail recipients to appear when I typed 1 letter. That function no longer works. Do I need to change a setting or what?

    Settings > Store > Sign Out.
    Sign in with the correct ID.

  • Can't export to thumbdrive.  I have saved to a folder on the desktop, and it still won't work.  Do I need to change a setting?

    Can't export photos to a thumbdrive.  I have saved them to a folder on the desktop, and it still won't work.  Do I need to change a setting?

    I have saved them to a folder on the desktop, and it still won't work.
    What still won't work?  You have the photos in a folder on the Desktop, right?  So what happens when you drag that folder onto the thumbdrive? Many such drives have a slider lock switch.  Make sure it's not in the locked position. 
    Otherwise give us more detailed info on your setup and issue.
    OT

  • Files that used to be visible are now hidden in Mavericks. How can I change the setting to view the same files as before? I do not need the hidden files that are typically invisible.

    Files that used to be visible are now hidden in Mavericks 10.9.1. How can I change the setting to view the same files as before? I do not need the hidden files that are typically invisible.
    I am having trouble locating such files as PDF's INDD, AI etc. When I view all hidden files and try to open it in the program..it looks like it is really not on the drive. Has anyone come across a solution?

    You may need to rebuild permissions on your user account. To do this,boot to your Recovery partition (holding down the Command and R keys while booting) and open Terminal from the Utilities menu. In Terminal, type:  ‘resetpassword’ (without the ’s), hit return, and select the admin user. You are not going to reset your password. Click on the icon for your Macs hard drive at the top. From the drop down below it select the user account which is having issues. At the bottom of the window, you'll see an area labeled Restore Home Directory Permissions and ACLs. Click the reset button there. The process takes a few minutes. When complete, restart.   
    Repair User Permissions

  • I need help with AppleScript for changing the font on numerous PowerCADD files

    I am currently trying to write an AppleScript, but I really have no idea how one is written.  I have looked up many tutorials, but to no avail.
    What I'm trying to so is write a script that will take all my selected PowerCADD files, open them, change the font to Helvetica, then save the file.  I have over a thousand files to do this to.  So, you can see my need of an AppleScript to get this task completed.
    If anyone out there knows how I would write this script, please submit it here.
    Thank you so much for your time and help.

    If anyone could help, that would be awesome  =)

  • Hi there  I need to change language setting from English US into English uk, in a Mac OS X 10.5.8, how can I do that?

    Hi there
    I need to change language setting from English US into English uk, in a Mac OS X 10.5.8, how can I do that?
    Many thanks

    Change your OS X language
    Your Mac is set to display the language for the country in which you bought the computer. For example, if you bought your Mac in the United States, your Mac is set to English. If you bought your Mac in France, your Mac is set to French. But if you prefer to use a different language, you can.
    If you bought your Mac in the U.S. but English isn't your preferred language,
    you can switch the language via drag-and-drop.
    Open System Preferences and click Language & Text.
    Click the Language tab.
    In the Languages pane, drag your preferred language to the top of the list.
    To apply the language throughout your system, restart your Mac or log out and log back in.
    You can also customize various aspects of any application by choosing Preferences from the application menu. For example, to configure settings for the TextEdit application, open it from your Dock or the Applications folder, then from the TextEdit menu, choose Preferences. Other application preferences can be configured in similar fashion.

Maybe you are looking for

  • IOS Photos - Proper Cloud Backup & Managemetn

    Am I missing a major point here, or is there a big gap in the iOS, iTunes, iCloud design for photo management the way most people (I would guess) want to do it? Excuse the underlining - brevity isn't my forte so trying to highlight the key points. He

  • HOW TO ACCESS ATTRIBUTES FROM DIFFERENT VIEW SET

    Hi Experts, How i can  access the variables declared in context class from component controller class and vice-versa. Thanks & Regards Ansal

  • How to route the Idoc to Two Different Locations based on the Plant Values

    Hi All, We will generate single Idoc, in that we will have 2 E1MARCM segments, one will have UK plant and another will have US plant. Now in XI, receiver determination i need to route the idoc to corresponding folders. How can we do this, because in

  • Tables in document header?

    After upgrading to the new Pages APP and then opening my company letter document which had a table within the document header with the company logo, address and page numbers in three separate cells, all of the table, cells and their contents were wip

  • JPanel help

    hey, I'm making a calculator program with a function graphing part using JFrame and JPanel. But these two have been causing problems because when I run the GraphMain class, only a portion of the graph shows up. I have tested the Main and Graph classe