Script to change wallpaper

I am looking for a way (script or porgram) to change my wallpaper selection based on what my IP is (like home or work) but also change the image randomly every hour or so (still making sure not to show a work image at home or a home image at work). Any one have idea ideas on how to do this?

Sorry I have never touched applescript before
in this case you might want to learn a little apple script if you'll be using a script like that. There are probably several ways to do what you want but the following should work.
paste the following into Script Editor (it's in /Applications/Utilities).
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 335px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
property ip_address : ""
set cur_ip to do shell script "ifconfig |grep inet |tail -1 | awk '{print $2}'"
if cur_ip is not equal to ip_address then -- check to see if the ip address has changed since last check. if it didn't - do nothing.
set ip_address to cur_ip
if ip_address = "home.ip.address" then
tell application "System Events"
-- RANDOM ROTATION OF A FOLDER OF IMAGES
tell current desktop
set picture rotation to 1 -- (0=off, 1=interval, 2=login, 3=sleep)
set random order to true
set pictures folder to file "path:to:home:images:"
set change interval to 3600.0 -- seconds
end tell
end tell
else if ip_address = "work.ip.address" then
tell application "System Events"
-- RANDOM ROTATION OF A FOLDER OF IMAGES
tell current desktop
set picture rotation to 1 -- (0=off, 1=interval, 2=login, 3=sleep)
set random order to true
set pictures folder to file "path:to:work:images:"
set change interval to 3600.0 -- seconds
end tell
end tell
end if
end if
</pre>
put the ip addresses of at home and at work in the above, as well as the corect paths to different folders with images. then save the script in your Documents folder. Call it, say, backgrounchanger. Then download [lingon|http://www.tuppis.com/lingon> and use it to make a launch daemon. make it run, say, every minute and execute the following command (enter it on line 2)
osascript /users/username/documents/backgroundchanger.scpt
Put your short user name instead of username in the above.
save the daemon and log out/in to activate it.

Similar Messages

  • Is it possible to script language change in OSX Lion ?

    I recently purchased a Disney game (Cars 2) from the App Store, which advertises being available in 5 languages. It seems now that the game has no in-app options to change language, but selects the language based on OSX settings (but otherwise the app doesn't use ANY of the GUI elements from the OS).
    My Mac's are all set up in English, in the account on which my kid plays the game doesn't have administrator rights (for good reasons). He doesn't master the English language enough and would like to play the game in dutch. On the other hand, when using Safari and other apps, he is used to the English user interface.
    Is it possible to create a script that changes the Finder language to Dutch, then forces Finder Quit, then launches the App, and after quitting the App reverses the Finder Change ? (or if not in one step, maybe in a number of subscripts), so that I can let my kid enjoy his game in dutch without me having to be present each time to change the system settings ?
    Thanks in advance.
    Philip

    Tom, thanks, this works perfectly. In older days, I have been a programmer on Mac (long before even the PowerMac days), and back then I would have used ResEdit to do something similar as what you suggested. Since those days are long gone, I was not sure if it was possible to change the resources of an app without extensive coding software, but the trick you just showed me seems to be the current-day equivalent of ResEdit ...
    Anyways, you saved our day ... thanks alot
    Philip

  • Powershell Script to change the default user Account picture for all users in windows 7 and 8

    Hello,
    Can some sone help me with PS script to change user account pictures of all user account in windows 7 and windows 8 ?
    I will deploy this through MDT TS as Custom TS after OSD.
    Shailendra
    Shailendra Dev

    Hello,
    Can some sone help me with PS script to change user account pictures of all user account in windows 7 and windows 8 ?
    I will deploy this through MDT TS as Custom TS after OSD.
    Shailendra
    Shailendra Dev
    The default user account picture is stored here.
    C:\programdata\Microsoft\User Account Pictures\user.bmp
    It should just be a matter have copying the picture you want to that location and over writing what is there.
    or....
    Computer Configuration\Administrative Templates\Control Panel\User Accounts\Apply the default user logon picture to all users
    You can also configure this by a registry setting;
     [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
      UseDefaultTile = 1
    The picture that you configure, will not be loaded until the user account will actually be created on the pc. Meaning the first time a >new< user will log on to a pc, they will have no picture shown at all using their login screen (this is default
    behavior). Same will occur if you enable the policy don't display last user name. However, once they log in the picture will be shown in the start menu, and if they lock their pc the image will also be shown

  • Powershell script to change the a column value of all documents in a site.

    Hi,
    I need a powershell script to change the value of a column (a site column which has been added to all document libraries) in all documents in a site,
    For example: 
    -column 1 is a site column added to all libraries
    the value of column 1 of all documents under this site: http://intranet.doman/ex1 should be equal to V1
    the value of column 1 of all documents under this site: http://intranet.doman/ex2 should be equal to V2
    So, if I can write a powershell script to change the value of all documents in a site, I can modify it for different site that I have and run it for each of them individually,

    cls
    # Is dev version?
    $dev = $false
    # Configuration
    $termStore = "Managed Metadata Service"
    $group = "G1"
    $subjectMatterTermSetName = "Subject Matter"
    # Check if SharePoint Snapin is loaded
    if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
         Add-PSSnapin Microsoft.SharePoint.PowerShell
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Taxonomy") | Out-Null
    function GetTermStore($site, $termStore, $group, $termSet) {    
        $session = New-Object Microsoft.SharePoint.Taxonomy.TaxonomySession($site)
        $termStore = $session.TermStores[$termStore]
        $group = $termStore.Groups[$group]
        $termSet = $group.TermSets[$termSet]
        return $termSet
    if($dev) {
        Write-Host "Running DEV version..."
        $webUrl = "http://Site1"   
        $libraryName = "L1"
        $subjectMatter = "C1"
    } else {
        $webUrl = Read-Host "Enter Site URL" 
        $libraryName = Read-Host "Enter Document Library name"
    $subjectMatter = Read-Host "Enter Subject Matter"
    try {
        $web = Get-SPWeb $webUrl
        $site = $web.Site
        $library = $web.Lists[$libraryName]
        $items = $library.GetItems()
        $subjectMatterTermSet = GetTermStore $site $termStore $group $subjectMatterTermSetName
        $subjectMatterTerm = $subjectMatterTermSet.GetTerms($subjectMatter,$true) | select -First 1
        foreach($item in $items) {
            if([string]::IsNullOrEmpty($item["Subject Matter"])) {     
                #Write-Host "Filename: $filename / Keywords: $keywords / Subject Matter: $subjectMatter / Document Type: $documentType"        
                Write-Host "Updating $($item["ows_FileLeafRef"])..."           
                # Set Subject Matter column
                $subjectMatterField = [Microsoft.SharePoint.Taxonomy.TaxonomyField]$item.Fields["Subject Matter"]
                $subjectMatterField.SetFieldValue($item,$subjectMatterTerm)
                # Update Item
                $item.SystemUpdate()
    catch
        $ErrorMessage = $_.Exception.Message
        Write-Host "Something went wrong. Error: $ErrorMessage" -ForegroundColor Red

  • [JS, CS3] a script to change language in all paragraph styles

    Hi,
    I made a script to change the language in all paragraph styles to "French", but when I run it I get the error: "Invalid request on root style". Could you please tell me what am I missing?
    myDoc = app.activeDocument;
    myStyles = myDoc.paragraphStyles;
    for (i = 0; i < myStyles.length; i++)
    myStyle = myStyles[i];
    myStyle.appliedLanguage = "French";

    Thanks a lot!
    The problem is solved
    Ola

  • In Firefox 2.0+ you can go to Advanced JavaScript Settings and check a box to allow scripts to change status bar text. How do I do this is Firefox 10.0.1?

    In Firefox 2.0+ you can go to Advanced JavaScript Settings and check a box to allow scripts to change status bar text. How do I do this is Firefox 10.0.1?

    Two items in the Advanced JavaScript window were removed as of the Firefox 4.0 version, but they are still available thru about:config .
    Type '''about:config''' in the URL bar and hit Enter. <br />
    ''If you see the warning, you can confirm that you want to access that page.''
    Filter = '''dom.disable_window_status_change''' = double-click to toggle to '''false''' to allow websites to mess with status text.

  • Scripts for changing the address of the user when they have been in the box for 6 months

    Scripts for changing the address of the user when they have been in the box for 6 months
    If users are in a folder for deactivated users and disabled users in Active Directory, and been there for 6 moths do: change email address in exchange to existing email address.old 
    Anyone have suggestions on how I can go about it?

    What is this "box"?  What is this "folder" you're asking about?  You'll likely get a better answer if you use standard terminology.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Script to change language

    I need to find all cyrillic characters in a file and set their language to Russian. CS3 cannot find them with grep, so I reckon on doing them one at a time, can anyone help me with an Applescript line which would find X and set its language to Russian? The cyrillic characters in the font in question (Baskerville 10 by Storm) are unicode 0401 through 0491, I'm not sure if the script line needs to be of text or glyph type...
    Thanks!
    Andrew Brown
    (PS. I use the sample find-replace script a lot, but don't know how to adapt it to this purpose.)

    That works perfectly, thanks Peter ! -- AB
    On 17 Feb 2008, at 18:16, Peter Kahrel wrote:
    > A new message was posted by Peter Kahrel in
    >
    > InDesign Scripting --
    > Script to change language
    >
    > CS3 cannot find them with grep
    >
    > Try this: search for [\x{0401}-\x{0491}] and set Rusian in the
    > Change Format pane. That should doe what you want.

  • Bash script to change a string in /etc folder?

    I am wanting to create a script to change one of the values for the authorization file.   (See Article TS3287 in the KB)
    I assumed that I could use the sed command to do this, but I am getting an error when attempting to run.  Any ideas?
    Below is the code I wrote ...
    #!/bin/bash
    OLD="<string>The owner or any administrator can unlock the screensaver.</string>"
    NEW="<string>(Use SecurityAgent.) The owner or any administrator can unlock the screensaver.</string>"
    DPATH="/etc/authorization"
    BPATH="/etc"
    TFILE="/tmp/out.tmp.$$"
    [ ! -d $BPATH ] && mkdir -p $BPATH || :
    for f in $DPATH
    do
      if [ -f $f -a -r $f ]; then
        /bin/cp -f $f $BPATH
       sed "s/$OLD/$NEW/g" "$f" > $TFILE && mv $TFILE "$f"
      else
       echo "Error: Cannot read $f"
      fi
    done
    /bin/rm $TFILE

    You do the testing- this script should work->
    #!/bin/bash
    #This script needs to run as root
    ROOT_UID=0
    if [[ $UID -ne $ROOT_UID ]]; then
    echo "YOU MUST BE ROOT TO RUN THIS SCRIPT"
    exit 1
    fi
    OLD="<string>The owner or any administrator can unlock the screensaver.<\/string>"
    NEW="<string>(Use SecurityAgent.) The owner or any administrator can unlock the screensaver.<\/string>"
    cp /private/etc/authorization /tmp/auth.tmp
    sed "s/$OLD/$NEW/" /tmp/auth.tmp > /tmp/authorization
    mv /private/etc/authorization /private/etc/authorization.previous
    mv /tmp/authorization /private/etc/authorization
    rm /tmp/auth.tmp

  • Urgent:How to modify a script without changing the print programme

    Hi all,
    Can any body pls tell me <b>How to modify a script without changing the print programme</b>
    Give m esome real time examples.
    Good points willbe rewarded
    Thanks

    Hi
    You can write a external Subroutine to fetch the extra data into the script program
    see the following sample code
    How to call a subroutine form SAPscripts
    The Form :
    /:PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
    /:USING &EKKO-EBELN&
    /:CHANGING &CDECENT&
    /:ENDPERFORM
    The report :
    REPORT zkrpmm_perform_z1medruck .
    DATA : BEGIN OF it_input_table OCCURS 10.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_input_table.
    déclaration de la table output_table contenant les
    variables exportées
    DATA : BEGIN OF it_output_table OCCURS 0.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_output_table.
    DATA : w_ebeln LIKE ekko-ebeln,
    w_vbeln LIKE vbak-vbeln,
    w_zcdffa LIKE vbak-zcdffa.
    FORM CDE_CENT
    FORM cde_cent TABLES input output.
    it_input_table[] = input[].
    it_output_table[] = output[].
    READ TABLE it_input_table INDEX 1.
    MOVE it_input_table-value TO w_ebeln.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = w_ebeln
    IMPORTING
    output = w_ebeln.
    SELECT SINGLE zcdffa FROM ekko
    INTO w_zcdffa
    WHERE ebeln = w_ebeln.
    it_output_table-name = 'CDECENT'.
    MOVE w_zcdffa TO it_output_table-value.
    MODIFY it_output_table INDEX 1.
    output[] = it_output_table[].
    ENDFORM.
    COPING SCRIPT
    There are some Standard Sap Scripts in SAP. We cant directly execute them in scripts we have to use some T-codes and by giving some input to the required fields we can see the output printform.
    I will show one example. There are some Standard Sap Scripts such as MEDRUCK which is a standard Sap Script for Purchase Order and RVINVOICE01 for billing and so on...
    To see oupt of MEDRUCK go to T-code ME9F give purchase order number and execute select one number and click on dislplay messages button on application tool bar you can find the print form of MEDRUCK.
    You cannot change the Standard Sap Scripts but you can use Standard Sap Scripts and Copy them to userdefined Script and can make changes to them and replace standard Sap Script with usedefind script.
    Ex: Go to SE71,
    on menu bar u find Utilities->copy from Client. click on it u ll find new screen showing
    Form name:
    Source Clinet:
    Target Form:
    give Form name as usedefined form name EX: ZFORM1
    Source client as 000 and
    Target form as MEDRUCK.
    execute.
    Now, the standard from MEDRUCK is copyied to your form ZFORM1.
    NOW, go to SE71 and give form name as ZFORM1 and do some changes to the form such as adding logo any thing. save and Activate.
    Now, you have done changes to the Form ZFORM1 and u have to replace your form with standard SAP Script.
    Go to NACE Transaction.
    on Applications select EF for purchase order and click Output types button on application tool bar.
    now select NEU as output types dobule click on Processing Routines.
    now click on Change option on application tool bar and on right side u find MEDRUCK in form place replace MEDRUCK with ZFORM1 and SAVE.
    go back twice and now go to T-code ME9F give the purchase order number and execute and select one option and click on display messges button .
    you will find the changes that you have done in ZFORM1. so we cant chage the standard Sap Scripts by copying the Standard Sap Scripts we can chage and replace with our forms
    Refer
    https://forums.sdn.sap.com/click.jspa?searchID=4089895&messageID=3239299
    Regards
    Message was edited by:
            Kiran Sure(skk)

  • Script to Change swatch CMYK values

    Are there any scripts available to change CMYK values of swatches for files in CS3?
    I have hundreds, probably thousands of Illustrator EPS files that use swatches all drawn from a total palette of maybe 50 colours.
    Each colour is named and has a corresponding CMYK value.
    I want to update the CMYK values for all ~50 colours that appears across all these documents. Is there some way I can simply change the CMYK spec of the swatches used by each of these documents by not having to manually open and change the colours etc?
    Even a script would be good that could batch process the files?
    For example:
    File contains a swatch as a named colour like:
    Fire Red spec'd as 0, 96, 99, 0
    I want to automate changing the CMYK values for all files containing Fire Red to, say, 0, 98, 99, 0
    Any ideas? I have searched Google for a couple of days.
    Edit: the flavour here is Illustrator for CS3 - both Win and Mac.

    I understand EXACTLY what you mean as it's the same thing I need to do, and will probably need to do on future occasions.
    Did you get anywhere with this problem?
    I have designed a scheme for a textbook I am illustrating (this is what I do for a living and have been doing so for well over a decade using Illustrator).
    All colours used in every illustration are based on 7 CMYK Global swatches, usually 100% tints but also 50% 75% and others when required.
    Anyway I have done 100 illustrations already based on my template when I realize I'm going to have to darken the green by +10% cyan.
    What I need is a script to change the definition of my global 'green' swatch in every document from 100Y 30C to 100Y 40C.
    Actions won't do it.
    Any suggestions?

  • Script to change Safari Preferences

    Hello,
    I'm trying to build a script to change Safari Preferences :
    "Tell Application Safari"
    Set the default browser as "Safari"
    End Tell
    But it does not work...
    I will need it to make this change on a lot of Macs from Apple Remote Desktop.
    Do you know where are located the Apple Script Commands in Safari ?
    Thank you
    Marc

    Hi krsmes
    Try this GUI script, make sure enable for assisted devices is on in all your macs.
    activate application "Safari"
    tell application "System Events"
    tell process "Safari"
    click menu item "Preferences…" of menu 1 of menu bar item "Safari" of menu bar 1
    click button "General" of tool bar 1 of window 1
    tell pop up button 2 of group 1 of group 1 of window "General"
    click
    click menu item 6 of menu 1 -- change the number 6 to what ever number controls safari as default browser for you
    delay 1
    --tell application "System Events"
    --if (name of processes) contains "Safari" then tell application "Safari" to quit
    --end tell
    --or
    tell application "System Events"
    if (name of processes) contains "Safari" then tell application "Safari" to close window "General"
    end tell
    end tell
    end tell
    end tell
    Budgie
    Message was edited by: Budgie
    tested on G5PPC 10.4.11

  • Script to change DNS

    Guys,
    We are changing the IP address of one our domain contoller which is also a DNS server. Need a script to change the dns server ip in about 70 servers, script should to change only the old ip address while the other 2 DNS addresses should remain as it
    is.

    You can try
    http://superuser.com/questions/463096/change-dns-with-script
    http://blogs.technet.com/b/heyscriptingguy/archive/2014/01/26/weekend-scripter-modify-dns-settings-via-windows-powershell.aspx
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/ed3f4c9e-1467-4795-b9d1-ae41937b8962/script-to-change-dns-servers-on-remote-server?forum=winserverpowershell
    -Greg

  • Script for changing InCopy assignment locations globally

    I have a book with multiple documents with hundreds of separate stories. I need a script to change the assignment locations globally within the ID document to a single folder. As it stands now, I can only change them one by one using their individual Assignment Options dialogue box in ID. Also, it would be nice to also be able to change the "Assigned to" field to a specific set of person(s).
    Someone had written a script a while back for ID2 that did just this but I can't seem to locate it. Not sure it would work with CS3.
    Anyone have any ideas?

    As Andbrowny asked, have you tried using OS X's Locations? See KB 106653, Using network locations in Mac OS X.
    If that doesn't give you the power that you need, checkout Location X.

  • Cant change Wallpaper

    Hi All,
    I know this is weird but i cant change my wallpaper!!!
    I go to Apple icon, system preferences, Desktop and Screensaver, Desktop, and the screen is blank..
    I have rebooted etc. Any other ideas if there is another way to change Wallpaper?

    Jasoncoau,
    Have you checked to see if the Desktop Pictures folder is still in its correct location (Macintosh HD >Library > Desktop Pictures)? When you browse to Desktop in Screensaver in System Preferences, it points to that folder. If the folder is missing or empty, that may be the problem.
    DW

Maybe you are looking for

  • Java is not working

    I'm having problem with Java installed in my Macbook Pro runing Lion 10.7.4. When  need Java applets they do not work, I went to Java preferences to clear old files, I checked the box to activate the plug-in, but it is not working, when I get back to

  • Trying to perform recovery RMAN in OEM.  Fails!!!

    I am trying to learn to do backups within OEM. I see it uses RMAN behind the scenes. Anyway, I have 2 databases residing on one machine. A production database "a" and a clone it "b". I performed the cloning in OEM fine. I then performed a full databa

  • [SOLVED] Konsole does not close when pressing Crtl+D / defunct bash ?

    Dear all, Since a few days, when I type exit or Crtl+D in a KDE konsole to close the bash session, konsole often does not close itself anymore automatically. I tried to close it manually using the GUI (File>Close tab), but then I have the following m

  • How to generate the return code automatically through EP

    Hello all,            I have created a transaction Iview and i am calling transaction SE16 to which i am passing application parameter as the table name which i want to see.Now i am getting the SE16 screen with the table name successfully passed on t

  • Does Portal Server 6 require Communications Express?

    I am trying to do the single install for evaluation in this document: Sun Java Enterprise System Technical Note: Deploying Java Enterprise System on a Single Host for Evaluation 2005Q1 Part Number 819-2201-10 I undertsand that the OS stated in the do