Apple Script command on background image

Hello,
So the thing is.
I want to creat this apple script that would react only when i switch to a certain space.
I searched in the interent and found out that the Mac has no easy way of finding out, on which space it is on, so my questions is.
Would it know what background image is on that space, so that if I changed to a certain space, it would recognise the background image file, and run my script.
I have just thought of this my self, so I will be testing too.
But I wanted to know if anyone one els out there has thought of it first and found an answer.
Thank you

Please consider submitting an enhancement request to Apple, requesting that information on the spaces be made available to applications and scripts.

Similar Messages

  • Apple script to find all image files on computer and put them into 1 folder

    Is there any way to do this with apple script? Thanks

    Hi glaurung,
    Doing this with vanilla AppleScript and the Finder would take too long. There might be a way to do this with unix commands, but probably the best way to this would be to use the built in find for your system. I wouldn't search the whole computer. Maybe just search somewhere in your Home folder. Use a criteria like all files with extension jpg, tiff, tif, etc.. Then you can just drag the found files into whatever folder you want. You need to be cautious because you wouldn't want to move all files. For instance, you wouldn't want to move all pictures in your iPhoto library, other apps, or the System.
    gl,

  • Sleep wake apple script commands

    Hi guys,
    i'm trying to run the below script and the computer enters to sleep but not wake up.
    in addition i intend to measure the time it took the computer to wake up from sleep.
    please advise how can this script will work
    many thanks,
    Rafael.
    --put computer to sleep
    tell application "System Events" to sleep
    set startTime to do shell script "date +%s"
    do shell script "/bin/sleep 2" --sleep for 2 seconds
    tell application "System Events" to activate
    set finishTime to do shell script "date +%s"
    set timeItTook to finishTime - startTime --count the time it took the mac return from sleep mode after got wake command (no the time it was in sleep mode)

    Hey, my mac needs just 1 sec
    --07.05.2011 hubionmac.com
    --skript that measures the time until wakeup is complete
    -- this gives a f*** about your wakeorpoweron settings, they will be deleted!!!
    set mystartup to build_pmset_date(1)
    set ct to current date
    tell application "Finder" to sleep
    repeat until 1 = 0
    if ct > mystartup then
    exit repeat
    else
    set ct to current date
    delay 1
    end if
    end repeat
    set diff to ct - mystartup
    display dialog "Waking up took me " & diff & " sec."
    --clean wakup-plan
    do shell script "pmset repeat cancel" with administrator privileges
    on build_pmset_date(plusminutes)
    set d to (current date) + (plusminutes * 60)
    --make sure that we will end up with at least 1 minute...
    if seconds of d > 30 then
    set d to d + 60
    end if
    set thehour to characters -2 through -1 of (("0" & (hours of d as integer)) as text)
    set theminutes to characters -2 through -1 of (("0" & (minutes of d as integer)) as text)
    --pmset does not care about seconds...
    set theseconds to "00"
    set seconds of d to 0
    set thetime to thehour & ":" & theminutes & ":" & theseconds
    --clean wakup-plan
    do shell script "pmset repeat cancel" with administrator privileges
    --set the plan
    do shell script "pmset repeat wakeorpoweron MTWRFSU \"" & thetime & "\"" with administrator privileges
    return d
    end build_pmset_date

  • Find raster Image & Vector image in adobe indesign using apple script?

    Find raster Image & Vector image in adobe indesign using apple script?

    Find raster Image & Vector image in adobe indesign using apple script?

  • Is there an ARD command or Unix command that I can send to reset the desktop background image to default?

    I was forced to create a local user with an automatic login on all of the machines in the building. I listed off many various issues that could come arise by doing this but was tuned out. Now people are changing all of the desktop backgrounds to some pretty inappropriate images. I forewarned the person ordering this that this may be one of the many issues that would arise when doing away with our server based logins, and now I am charged with fixing every desktop every time someone changes it to something inappropriate.
    Is that an Apple Remote Desktop command or a Unix command that I can send through ARD v3.5.3 to the machines to reset the desktop background image to the default Aqua Blue jpeg image located in the /MacintoshHD/Library/Desktop\ Pictures/Aqua\ Blue.jpg.
    The machines that I am dealing with have OS X 10.4.11, OS X 10.5.8, OS X 10.6.8, and OS X 10.7.4 installed on them, but the OS X 10.4.11 machines are the ones that are creating the biggest issue so I would like to deal with those first.

    Ya, I'd love to have the computers connected to the Xserver, unfortunately against my heeding, I was ordered to take them off of the Xserver, so they only have a local account that automatically logs in on startup, and even though I have Parental Controls set, I can not stop them from going to Safari, selecting an inappropriate image and setting it as the background, so now I’ve been ordered to fix all of the backgrounds that people are messing with.
    My Xserver is running OS X 10.4.11 Server Edition. Yes, I would love a new server, but that’s not happening due to budget cuts.
    So what I am hoping for is a command that I can put into Apple Remote Desktop v3.5.3 and push out to all of the computers via its Unix commands and reset all the desktops to their default image.

  • Changing background via apple script

    Hello,
    I manage a small deployment of different macintosh products and I currently have to run 5 different images so that the background images look right on all the various resolutions. I have been working on a piece of applescript to prompt the user on first startup to select their hardware type to apply the proper background image but I am running into a few issues.
    Firstly the method I am using limits me to three options and I cant seem to find any documentation on how the list function works.
    Second, I keep getting errors saying the files can't be found.
    Here is the code (with personal details removed) that I am working with
    display dialog "Choose your hardware type" buttons {"17MBP", "15MBP", "iMac21"}
    set situation to the button returned of the result
    tell application "Finder"
              set desktop picture to {"MacOSX:Users:USERNAME:Technical:Backgroundimages:" & situation & ".gif"} as alias
    end tell
    I would really like it to automatically detect the hardware type but I don't think that is possible. The error I currently get says:
    error "File MacOSX:Users:USERNAME:Technical:Backgroundimages:15MBP.gif wasn’t found." number -43 from "MacOSX:Users:eventequipment:Technical:Backgroundimages:15MBP.gif"

    Applescript panels are limited to three buttons.  if you need more than three choices, use the choose from list command:
    choose from list {"alpha", "beta", "gamma", "delta", "epsilon"}
    however, you ought to be able to gather the information you need without user interaction.  you can base a choice on machine type using code like the following:
    set machineType to paragraph 6 of (do shell script "system_profiler SPHardwareDataType")
    if machineType ends with "MacbookPro2,2" or machineType ends with "…" then
              set situation to "MBP15"
    else if machineType ends with "…" or machineType ends with "…" then
              set situation to "MBP17"
    else if machineType ends with "…" or machineType ends with "…" then
              set situation to "iMac21"
    else
      -- set default or throw error
    end if
    or it might be more convenient to base it on screen resolution using something like the following
    set displaySize to paragraph 17 of (do shell script "system_profiler SPDisplaysDataType")
    if displaySize ends with "1440 x 900" then
              set situation to "MBP15"
    else if displaySize ends with "…" or displaySize ends with "…" then
              set situation to "MBP17"
    else if displaySize ends with "…" or displaySize ends with "…" then
              set situation to "iMac21"
    else
      -- set default or throw error
    end if

  • Can a script be written to take the next 2 files in a folder and place them on a background image..then saving with the first images filename..?

    Hello all, I hope you can help.
    In Photoshop I have a problem to overcome and have delved into the world of scripting..
    If there is a quick way to produce the following could someone help me with some pointers?
    Here is my situation..
    I need to produce a photograph proof card, these are for a double image option so cause me a headache compared to just creating an action..
    This proof card really is just a set of two different photographs placed onto a background image.
    I would produce two different images of the same person and name them exactly the same except they are suffixed with an A or B to keep them together, these would be in a folder with approx 500 other images for example (250 x two of each person)
    My preference for the process would be done in the following sequence:
    1/ Open the background file jpg (which is sized at 2400 x 1800 pixels @ 300dpi)
    2/ Load the first image from the batch file and place this.
    3/ Get the filename of the first image and create it as a text layer and write it below the image at 10 point text size.
    4/ Create another copy of this layer and change the font to 3of9barcode font, however the font needs an asterisk before the text then again after it. e.g. *filenameA*
         Only the first image has the need for a barcode as they are for the same person. This is at 18 point.
    5/ Load the next sequential image from the batch file and place this.
    6/ Get the filename for the second image and as Item 3/ create a text layer below at 10 point text size.
    7/ Place a png overlay with my copyright information over the images (I need to do this twice, once for each image)
    8/ Flatten the images and save the file in a new folder with the same filename as the first image.
    I can do this in Lightroom with the exception of putting the barcoded text, and the filenaming, this is because the background image is used as the identity plate and the filename is not based on the data from either photograph..
    Can anyone shed some light on where to go from here?
    Kind regards
    Bryan

    Photoshop Scripting-wise this seems fairly "easy".
    But I would recommend creating a template file (that already combines background image, png overlay and the Type Layers).
    Maybe data driven graphics would also be an option …
    Photoshop Help | Creating data-driven graphics

  • How do I stop Apple Script from leaving a Text.txt file with each image downloaded using Photo Downloader in Adobe Photoshop CS4_Bridge???

    I use Adobe Photoshop CS4_Bridge _Photo Downloader to import images from CF Cards into my 11" Mac Book Air.  I have an issue with the Text files
    that seem to accompany each and every image that I do not need.  How do I stop Apple Script (which I assume is the culprit in this case)  from interferring with this process.

    Your iWeb Site is stored not on your iDisk, but on a file named Domain.sites in your ~/Home/Library/Application Support/iWeb/ Folder.
    If , for whatever reason, you wipe your HD and/or lose this file (Get a new computer, Re-Install your OS, Stolen Laptop, Crashed HD, Etc.) without backing-up your Domain.sites file then you will have to re-build your iWeb sites from scratch again.
    Of course you can edit your Published HTML files in a different program such as Dreamweaver or even Text Edit. You just can't edit Published HTML files in iWeb. Not at this time at least.
    Use iWebBackup to backup your Domain file to a Blank CD or DVD. Backing up your Domain file to another folder on your computer is not fully backing it up. If your computer gets stolen you still lost the file but if you have your Domain file burned onto a CD you have a backup!
    Download iWebBackup Here
    You can use iWebExtender to automatically consolidate your files into one folder and delete multiple images.
    http://iWebFAQ.com

  • Apple Script to rename images using CSV file

    Hello, I have build a website using a Woocommerce for Wordpress. The site is going to have over 1200 images and they need to be renamed appropriately for each product. I've never used Apple Script before but after hours and hours of searching I have noticed people with similar issues have managed to solve the problem using AppleScript.
    I have attached a screenshot of the CSV file first 20 files - also the images are all saved in a folder with the names _DSC7916 copy 2.jpg etc etc.
    Hopefully my issue makes sense,

    In applescript it goes something like this:
              this all assuming the CSV file is a plain text file with a comma delimiting
              the old and new filenames on a given line. If you have another structure
              you need to give specifics so this can be modified
    set theCSVData to paragraphs of (read "/path/to/theCSVFile.csv")
    set {oldTID, my text item delimiters} to {my text item delimiters, ","}
    repeat with thisLine in theCSVData
              set {oldFileName, newFileName} to text items of thisLine
              tell application "System Events"
                        set name of file oldFileName of folder "path/to/folder of images" to newFileName
              end tell
    end repeat
    set my text item delimiters to oldTID
    Note that I've made a lot of assumptions about your csv file, any or all of which may be wrong. please clarify as needed.

  • How to make Apple Script do a terminal command

    Hey,
    I am wondering how can I make an AppleScript do the following command :
    "networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4"
    Please mention step by step since I'm new to AppleScript
    Best Regards,
    Nadav.

    To run a terminal command it is usually sufficient to use do shell script. So for your command it would be
    do shell script "networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4"
    note if the command requires administrator privileges you would need to do
    do shell script "command"  with administrator privileges
    will prompt for the password when the script is run.
    do shell script "command" user name "me" password "mypassword" with administrator privileges
    will store the password and username in the script. More convenient but much less secure.
    See do shell script in AppleScript

  • Sudo command in apple script? Encrypting apple script?

    Hi,
    1. I need a way to enter my root user password in applescript (when you run sudo in terminal you are prompted for a password, this is not so in apple script. So how do you tell apple script what the password is?)
    2. Can i encrypt my applescript with a password so that only i can open it?
    Thanks,
    Patrick.

    # 2 works great, #1 not so much... ive been trying
    tell application "Terminal"
         do shell script "su"
    end script
    any way i can auto enter my password following "do ....Su"?

  • Does anyone know the apple script or unix command in ARD that allows me to send keystroke commands to computers on my ARD network ? thanks !

    I am trying to cue computers through keystroke commands using ARD
    I want to know a unix shell or script command to hit keystrokes on my ARD machines.
    EXAMPLE... I want machine X  to press the letter K.
    I am also wondering if you can send multiple commands doing this , multiple keystrokes with built in delays
    Thank you

    Welcome,
    I use the "System Events" handler, e.g.:
              tell application "System Events" to delay 5.5
              tell application "System Events" to keystroke "K"
              tell application "System Events" to delay 0.5
              tell application "System Events" to keystroke return
    Regards,
    Shawn

  • Scripts-background image

    Hi..,
         How can i insert the image as Background for a page. When I search in SCN..   I saw
                                             select page node--> three tabs
                                                                   attributes
                                                                    O/p options
                                                                    background picture-- in this u can select ur image for bkground
    When I am trying this ., in the page node --- standard attributes, print attributes and page counter. I didnt get that bkground picture option. Can anybody help me How can i insert the bkground image??..
    Regards,
    Prathima.M

    HI,
    refer to this Link...
    Re: *Logo* in the *background* of the form page.
    Background Image
    Edited by: avinash kodarapu on Dec 6, 2008 12:59 PM

  • Apple Script "do when pressed" command?

    hey guys i need the right command that would activate a script once i press F1 (for example)
    So it should be smthg like:
    If F1 is pressed Then
         tell application "System Events"
              keystroke "123"
              keystroke tab
              keystroke "134"
         end tell
    else
         do nothing
    end if
    and i save the script under what?
         I need it to work either in text edit- pages- safari.... ect... (wherever there's a text box)
    THANK YOU

    To run a terminal command it is usually sufficient to use do shell script. So for your command it would be
    do shell script "networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4"
    note if the command requires administrator privileges you would need to do
    do shell script "command"  with administrator privileges
    will prompt for the password when the script is run.
    do shell script "command" user name "me" password "mypassword" with administrator privileges
    will store the password and username in the script. More convenient but much less secure.
    See do shell script in AppleScript

  • Vocal command:how Apple script ?

    Hello, i'm new and i've got a question about Apple Script.
    I want to use the Vocal  Recognition for my app, is it possible?
    For example, i say to my computer "open safari and search to google "APPLE"" end the computer do that.
    I know that there is a similar program on the Preferences but i wan't to do another app to learn how to use the apple script.
    Thank you, bye!

    Try this
            -- Script Start
             set answer to text returned of (display dialog "Press the function key twice and talk" default answer "" buttons {"OK"} default button 1)
             if answer contains "open safari" and answer contains "google" then
                      set search to text ((offset of "google" in answer) + 6) thru -1 of answer
                      tell application "Safari"
                               open location "https://www.google.com/search?q=" & search & "&oq=" & search & "&aqs=chrome..69i57j0l5.1526j0j1&sourceid=chrome&espv=210&es_sm=91&ie=UTF-8/"
                      end tell
             end if
            -- Script End
    Hopt this helps

Maybe you are looking for