A quick apple script

i need to make an apple script that can -
take a snapshot of the screen right before screen saver begins. place it into a specific place and replace the last one that was there.
anyone know how to do this?

You might have better luck getting help via the Applescript forum...
http://discussions.apple.com/forum.jspa?forumID=724&start=0

Similar Messages

  • Apple script to batch rename files by deleting tags on front and back of the file name

    Hi, I'm trying to rename a couple thousand files from their current format:  "01074_Something Of A Dreamer_Mary-Chapin Carpenter.lrc"
                                                                                                                           "01075_Where Did We Go Right_Lacy J. Dalton.lrc"
                                                                                                                           "01076_Everybody's Reaching Out_Crystal Gayle.lrc"
                                                                                                         To simply:  "Something Of A Dreamer.lrc"
                                                                                                                           "Where Did We Go Right.lrc"
                                                                                                                           "Everybody's Reaching Out.lrc"
    I just want to delete the number tag on the front and the artist name at the end for all of the files.  I imagine a Script to do this wouldn't be too hard to write, something along the lines of read file name after the first '_' character it reads until it reads a second '_' character and rename the file to the string it reads between those two underscores with .lrc at the end.
    Unfortunately I know nothing about Apple Script other than it seems like the thing I would need to automate this process based on my limited google searches.  If someone could help me out with some advice on how to go about making this script or obviously if you simply have and/or can quickly write a script to do this it would be greatly appreciated!

    Here:
    tell application "Finder"
    repeat with this_file in (get files of window 1)
    set the_name to name of this_file
    set temp_name to items ((offset of "_" in the_name) + 1) thru -1 of the_name as string
    set temp_name to (items 1 thru ((offset of "_" in temp_name) - 1) of temp_name as string) & items -4 thru -1 of the_name as string
    set name of this_file to temp_name
    end repeat
    end tell
    (123647)

  • Apple Script/Program start through link on HTML page

    Dear Apple Gurus
    Probably I'm asking something silly, but I don't know any other way to solve my problem.
    I have to do some training videos about the finder and system tools. To have it easy, I would like to ad some buttons to the project where you can start an apple script which does execute some commands just explained in the video. Untill know I'm intend to do the hole thing inside QT but maybe a HTML page does the job too.
    My problem is now, how can I start a AppleScript out of a Movie or HTML page.
    Is this possible at all or are there any other solutions to to the job?
    Best regards
    Thomas Thaler

    Hi Thomas,
    Yes, you play movies in a smil presentation.
    You can define as many regions as you want. You difine regions in the layout:
    <layout>
    <root-layout background-color="blue" width="320" height="290"/>
    <region id="videoregion" top="0" left="0" width="320" height="240" fit="meet"/>
    <region id="textregion" top="240" left="0" width="320" height="30"/>
    <region id="linkregion" top="270" left="0" width="320" height="20"/>
    </layout>
    I got part of this from the internet, but here's a quick explanation. The root-layout part defines the whole area. Within this area you have regions. The first region defines the video region and you can give it any id. The origin of the screen is upper-left. fit="meet" means the the movie will be proportional to fit the whole movie. You can change it to other parameters (read the link from the last post). So here, three regions are defined. The first is for the movie (I used a slideshow from iPhoto), the second is for captions in the middle, and the third region is for the link region at the bottom of the screen. You can use any region as a link. Within these regions you place your movies, text, etc. (see the link for more types).
    You next place your types in the body:
    <body>
    <par>
    <!-- VIDEO -->
    <video src="slideshow.mov" region="videoregion" id="mov"/>
    <!-- CAPTIONS -->
    <textstream src="caption.txt" region="textregion" system-language="en" system-captions="on" title="english captions" alt="english captions"/>
    (a href="file://localhost/Users/kel/Desktop/linkapp" show="new")
    <text src="text.txt" region="linkregion" end="id(mov)(end)"/>
    (/a)
    </par>
    </body>
    video src says what type of object, slideshow.mov is the name of my movie. If you place the movie in the same folder as the smil file, you can use just its name like I did. Then you enter what region you want the movie in. The id="mov" part is to give this video a reference for later use. I used it to keep the text in the link area running until the movie ended. You don't need captions if you don't want, but if you do here's an example of my captions.txt file:
    {QTtext} {font: Arial} {justify: center} {size: 12} {backcolor:0, 0, 0} {timescale: 30} {width: 320} {height: 60}
    [00:00:00.00]
    Kelvin: Here is my movie.
    [00:00:04.15]
    {justify:left} {italic} Here is more text. {plain}
    [00:00:07.04]
    After 4 15/30 seconds the text changes.
    So altogether, I had five files in the same folder: the smil file (slidshow.smil - plain text), the movie (slideshow.mov), the caption text (caption.txt - plain text), and the text file for the link region's text (text.txt - plain text). The script application was on my desktop:
    "file://localhost/Users/kel/Desktop/linkapp"
    It's easy to get a local file url through applescript:
    set f to choose file -- the script app
    tell application "Finder"
    set the_url to url of f
    end tell
    and the the local file url is returned in the result.
    The movie needs work. I was playing around with the colors. blue is not a good background color.
    One thing I forgot to say is that you need to read more about the timing (duration). There are a lot of examples and tutorials on the Internet also. It's not that hard though. One thing you might have trouble with is getting repeats to work. I don't think they do.
    gl,

  • Apple Script to Check for System as well as Applications Updates?

    Hi,
    I was wondering if someone has created an Apple Script to check for Finder as well as Applications updates automatically.
    Thanks,
    Nawaf
    MacBook 13" 2Ghz 2GB   Mac OS X (10.4.7)  

    There wouldn't be any updates to the Finder separately. Any system updates are announced by Apple when they're available, and this is what the Software Update feature is for.
    If you go to System Preferences->Software Update, you can set it to automatically check for updates, or you can check manually. Monthly is usually the best schedule to check for updates, as Apple doesn't often release things on any quicker schedule.
    Mulder
    If this answered you question, please consider awarding some points. Why Reward Points?
    iMac G4 700Mhz   Mac OS X (10.3.9)  

  • Automator workflow to an apple script

    Hello,
    i have a few problems with the automator utility:
    1. my automator work flow is to open an application and type a password.
    the problem is when i recored and i'm typing the password, after i'm running the workflow seems that its not possible to type password, is there a way to type password while recording?
    2. i have an automator workflow and i wish to convert it to an apple script.
    after i've copy paste it to the apple script editor it seems to be the workflow but when i running the
    script it not running.
    please help...
    Rafi.

    Since you're using Mail, you might be able to have Mail do it.
    You can set up a rule in Mail in its preferences to match an email with unique characteristics, such as certain content or a certain subject exactly. You might want to add a few conditions and "match all" to make sure you don't accidentally match something else.
    Anyways, you choose to have the rule run an AppleScript. I haven't tested it by referencing an Automator workflow, but it might work. You might try a quick test first with a simple workflow.
    You'd have to be logged in and have Mail automatically check for email, perhaps every minute or every five minutes. If you don't want to be logged in, likely you'll need to use a web page, like you suggested. I'm not sure what you need to do for that to work.

  • MIRC XML to Apple Script

    How would I convert this over into apple script?
    ; XPL Staff Client
    ; file: scripts/support.xpl
    ; last modified: 01/09/2009 @ 19:10 EST
    alias se_channext {
    msg XPL|HelpServ next
    alias se_next {
    msg XPL|HelpServ next
    on :NOTICE::?:{
    if ($nick == XPL|HelpServ) {
    if ($1-5 == You have been assigned request) {
    set %spreq.id $remove($6,:,ID#)
    inc %strack_requests 1
    if ($2 == Nick) { set %spreq.nick $3 }
    if ($2 == Opened) { set %spreq.wtime $10- }
    if ($2 == Message:) {
    set %spreq.message $3-
    msg #XPL-Support Hello $+(,%spreq.nick,) $+ , welcome to #XPL-Support. I am your assigned helper ( $+ $me $+ ) for the request (ID#: %spreq.id $+ ). I have contacted you via private message, please respond to me there. (/query $me $+ )
    query %spreq.nick Hello, welcome to #XPL-Support. How may I help you?
    on *:OPEN:?:{
    /*if ($away == $true) {
    msg $nick 12,1(14- 12X0treme 12P0rofessional1512 L0eague1512Æ 14∑ 0www.XPLeague.com 14-12)
    msg $nick 12,1(14- 0I have $chr(91) $+ $query(0) $+ $+ $chr(93) query windows open. 14-12)
    msg $nick 12,1(14- 0I have not been here for $duration($awaytime) because: $awaymsg 14-12)
    msg $nick 12,1(14- 0If you need support, go to #xpl-support 14-12)
    msg $nick 12,1(14- 0Or, you may email me - $sinfo(email) 14-12)
    halt
    if (%query_block == 1) {
    msg $nick 12,1(14- 0I am not taking any private messages at the moment. If you need help, please go to #xpl-support. 14-12)
    msg $nick 12,1(14- 0You can PM me here: http://community.xpleague.com/Index.php?/user/273-xpl-danal/ 14-12)
    msg $nick 12,1(14- 0You can email me at the following email: $sinfo(email) 14-12)
    close -m $nick
    halt
    msg $nick 12,1(14- 12X0treme 12P0rofessional1512 L0eague1512Æ 14∑ 0www.XPLeague.com 14-12)
    msg $nick 12,1(14- 0I currently have $chr(91) $+ $query(0) $+ $+ $chr(93) query windows open. 14-12)
    msg $nick 12,1(14- 0If you need help, please go to #xpl-support 14-12)
    if ($away == $true) {
    msg $nick 12,1(14- 0I have not been here for $duration($awaytime) because: $awaymsg 14-12)
    msg $nick 12,1(14- 0You can email me at the following email: $sinfo(email) 14-12)
    }

    That looks to be a bit of work, especially if you don't have a knowledge of mIRC and ircII scripting. mIRC scripting can be translated (more or less) into ircII reasonably well (since that is where just about everything started way back when), but Colloquy doesn't support that. Just taking a quick look at some examples, using Colloquy's scripting dictionary seems to be fairly convoluted. There are some examples of Colloquy scripts here.

  • Sending email using apple script...

    I have created a watch folder using apple script that when a file is dropped on it, it automatically opens, formats, and sends out a custom email.
    What I don't understand is, how can I include multiple variables in the "content" section (also known as the body section of the email)? I want to put custom type in the content section that says "There is a file awaiting your review." I also would like to choose an email signature from my mail program to use. Third, I would like to include the name of the file that is being sent....
    I found that by doing {content:iteminfo} I could get the file name...If I do {content:"There is a file awaiting your review."} I could get the custom type I wanted....
    BUT, I can't figure out how to get BOTH of them together in ADDITION to adding a custom email signature...
    I know there are some really smart people out there...Any tips?

    I can't figure out how to get BOTH of them together
    This is just standard AppleScript text concatenation with the &:
    ... {content: "There is a file awaiting your review: " & iteminfo}
    Here you can see I'm concatenating a literal string (enclosed in quotes) and a variable. You can extend this ad infinitum.
    As for the signature:
    tell theMessage to set message signature to signature "My Sig"
    (which assumes you have a signature named 'My Sig'. Adjust as necessary.

  • New to apple script...

    Hi I am new to apple script; I was using Automator but it became too dumb to it's surroundings after a while. Can you please tell me why these don't do what I think they should; Safari has 2 windows open one with four tabs (window 1 as I have used exists to be sure of) and one with 9 (window 2).
    tell application "Safari"
    activate tab 6 of window 2
    end tell
    all it does is bring the frontmost safari window up
    Please help

    There are a couple of reasons behind this, mostly because you're using the wrong command.
    The main thing is that the 'activate' command is used to activate the application. Any other parameters (such as 'tab 6 of window 2') are discarded.
    Instead, the appropriate syntax is to set the current tab property of the window:
    tell application "Safari"
      set current tab of window 2 to (tab 6 of window 2)
    end tell
    It's a little verbose, but it works.
    If you also want to bring that window frontmost you need to change its index:
    tell application "Safari"
      tell window 2
        set current tab to (tab 6 of window 2)
        set index to 1
      end tell
    end tell
    Note though that changing the window index will now also change this window to 'window 1' instead of 'window 2'. Something to bear in mind if you're taking further actions.

  • How can I get the size of a file with apple script

    I try to get the size of a file within an apple script. But I did not find information how to do this.

    There are two ways. I think Apple is moving toward using System Events, which is listed first.tell application "Finder"
    set myFile to selection as alias
    --this just gets a file for me to work with
    --coercing it into an alias is required for the other functions
    end tell
    tell application "System Events"
    get size of myFile
    end tell
    set myInfo to (info for myFile)
    get size of myInfo

  • How to call a perl script from an apple script

    Hi All,
    How to Call a perl Script from an apple script.
    Pls Give Your comments.
    Thanx & Regards,
    Esther

    Applescript to call a perl script named "/tmp/x.pl" passing an argument "world"
    do shell script "/usr/bin/perl /tmp/x.pl world"
    or if the script is given the executable atttribute (chmod +x /tmp/x.pl),
    do shell script "/tmp/x.pl world"
    Perl script "/tmp/x.pl" that prints a string using a passed argument
    #!/usr/bin/perl
    print "Hello $ARGV[$1]\n";

  • How to disable the option of "Overprint [Black] Swatch at 100%" in Indesign by Apple Scripting

    Hi Friends,
    I am new to Indesign Scripting by Apple Script. As a beginner, I am trying to do some basic scripting in Indesign by Apple Script.
    My aim is to disable the option of "Overprint [Black] Swatch at 100%" in Indesign. This option is available when we go to Indesign ---> Preferences----> Appearance of Black.
    Also, if a user opens a file, in which the swatch is already enabled, then it should prompt him for disabling.
    I can make a display dialog in AppleScript. But, I am bit unsure as how can I go ahead and disable this option. I tried this below script:
    tell application "Adobe InDesign CS4"
          tell every layout window to set overprint preview to false
    end tell
    However, it is changing the view option to overprint preview.
    Appreciate your help and suggestions!
    Thanks,
    Abhishek

    tell application "Adobe InDesign CS5"
              tell the active document
                        set overprint black of document preferences to false
              end tell
    end tell

  • Install and uninstall of dmg file using Apple script in Mac 10.6 and higher version.

    Hi ,
    Could anyone please help me to write a Apple script to Install dmg file and do clean uninstall in Mac 10.6.8 and higher version.
    My requirement is:
    When i run script : it has to install the dmg file which is located inside one desktop folder say 'New Folder'
    I need to do clean unistall when i run the script: i need to delete the folder in ~/Library- locate folder say  'CPSPCSHOWSERVER'' move to trash and from Terminal type in command "rm -r ~/.CPS' to completely delte this folder.
    Really appreciated all ur help!!
    Thanks,
    KT.

    http://macfidelity.de/2008/08/30/how-to-mount-a-dmg-from-terminal-in-mac-os-x/in dex.html
    http://osxdaily.com/2011/12/17/mount-a-dmg-from-the-command-line-in-mac-os-x/
    http://hints.macworld.com/article.php?story=20030614230204397
    http://www.commandlinefu.com/commands/view/2031/install-an-mpkg-from-the-command -line-on-osx

  • 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

  • Can I use Apple Script to press a button?

    Is there some way I can create an Apple Script to run and press a button in another application, or create a "plug-in" type script for the program to make the button into a something that can be used by a keyboard shortcut?
    I ask because I have an application that I can use to operate my digital camera, however, the button that Auto-Focuses then Shoots a photo does not have a keyboard shortcut. This is a problem because I also have the App "Snatch" on my iPhone, and, long story, short, I discovered I could use Snatch on my laptop on an Ad-Hoc network from about 1,000 feet away, maybe more. If I could find a way of making the "AF and Shoot" button into a keyboard shortcut, or create a script that could be triggered by a keyboard shortcut to press the button, I could use Snatch to control my camera remotely, far better then any part I would by from Nikon, or a third-party (Trust me, I have used a lot of them, and this method beats them all, save for the fact that I can't use bulb.)
    Anyway, thanks for any input, if any.

    Even if an application is not scriptable, you can generally use [GUI Scripting|http://www.macosxautomation.com/applescript/uiscripting/index.html] to press a button. For example, using Canon's RemoteCapture DC software, the script below will press the "Release" button of the main window:
    tell application "RemoteCapture DC" to activate
    tell application "System Events"
    tell process "RemoteCapture DC"
    click button 4 of window "RemoteCapture DC"
    end tell
    end tell
    If you then put the above script in the AppleScript menu in the menu bar, you should be able to use a third party application, like Quicksilver, to assign a keyboard shortcut to it.
    Message was edited by: Pierre L.

  • How to check indesign version installed by Apple Script

    Hi Friends,
    I want to make an apple script which will check for the version of Indesign installed in the "Applications" folder.
    I tried using "exists" function of Finder. But seems something is missing/incorrect.
    tell application "Finder"
              exists application file "Adobe InDesign CS4" of folder "Applications"
      end tell
    Please can you suggest.
    Thanks,
    Abhishek

    Hi Niel,
    Thanks for your email.
    Basically, I need to check whether a user has which version of Indesign on his mac like (CS3, CS4 etc)
    Accordingly, I have to create different loops.
    I have CS4 installed on my mac but when I run the below
    tell application "Finder"
              exists version of application file "Adobe InDesign CS4" of folder "Applications" of startup disk
    end tell
    The result is false.. even though I have CS4 installed. And, if I try
    get version of application "Adobe InDesign CS4"
    It gives o/p as  "6.0.6.622"
    Thanks for your help!
    Abhishek

Maybe you are looking for

  • Calculating Square root.

    Hi, I'm suppose to write a programme that asks the user to enter a number. Find the square root of that number. Format theoutput to 4 decimal places. Use Math.sqrt(double a). i.e. to find the square root of 9.56, use: double sq = Math.sqrt(9.56); Thi

  • JRC bug: apostrophe in string parameter passed to Crystal Report with Command datasource to SQL Server

    Post Author: nl11087 CA Forum: JAVA A single quote/apostrophe in string parameter passed to a Crystal Report with Command datasource connecting to a SQL Server database, using sqljdbc driver does not escape the special character correctly. When doing

  • Spry horizontal menu problem in IE and Chrome

    First I'd like to express my frustration with spry. I spend way too much time trying to "band-aid" spry to work in different browers. I'll admit that I'm new to the web game but I seem to spend a large percentage of my time simply trying different "f

  • Procurement type and procurement indicator

    hi all, There is a mismatch  occurred in procurement in PS. i have configured a procurement indicator in ps and in control data i have checked PReq Network. After that When i assigned a material to the activity . In material details under purchase da

  • Can you pls tell me how to unfreeze my iMac?

    Can you pls tell me how to unfreeze my iMac?