Make computer sleep using automator or script

What I am trying to do is, I want to have an icon on my desktop which when pressed will put my computer to sleep and require me to enter a password to wake it. At all other times, when the computer goes to sleep, I don't want to need to enter a password to wake it. For example, if I close the screen ( its a MacBook Pro) and reopen it, then i shouldn't have to enter a password.
Is this possible to do using apple script or automator?

don't worry, I found a script to do this job. If anyone else is interested try this.
http://www.macosxhints.com/article.php?story=20090212074725172&query=sleep

Similar Messages

  • Pressing the 'F' key when in Finder makes computer sleep.

    Since yesterday, when the focus is on Finder, every time I press 'F', my iMac goes to sleep. I've looked at keyboard shortcuts and can't find any that I've changed. Its annoying because I can't rename files or folders to any name containing an 'F'. I don't know how to fix this.
    When I click the Apple menu, right beside 'Sleep' there is an 'F', but only when focus is on Finder.

    sebastian406 wrote:
    Thanks a lot, that worked. How do you think it happened in the first place?
    I haven't the foggiest. Normally, to create a shortcut you have to go to system preferences->keyboard&mouse->keyboard shortcuts and create a new shortcut there. this requires a lot of user input and i have no idea how it could have happened by itself.

  • Using Automator to change Kensington Trackball Settings

    Hi All,
    I have several shared company computers, all have the Expert Kensington Trackball Mouse. The computer in question is an Intel Mac Pro running Leopard. I have 2 sets of users that need to use the rig and both sets of users prefer different settings to the Kensington Mouse (I only need 2 separate profiles, not 4). Kensington does not provide software to quickly switch user profiles. The simplest solution is to create different users for the computer, but that is not an option here. We've been trying to use Automator to script the changes quickly between mouse profiles, but while using the 'Watch Me Do' (none of us are particularly experienced with Automator) feature, we are able to set the bottom two mouse buttons, but the top 2 buttons result in the error message "This operation cannot be performed". The Kensington settings are in System Preferences, and have several drop-down menus and text boxes. There must be a better way to do this. Any ideas? Thanks in advance!

    I have a similar problem with the ultra sensitive trackpad with the "Clicking, Dragging, Drag lock" checked in Preferences/Keyboard & Mouse. I'm always turning them on and off depending on which application I am using.
    My problem is that when I record a series of actions in Automator, the resulting action list has no text behind the action for the mouse click for the Clicking checkbox. Its as though it doesn't even know that its there. All of the other actions show up.
    Got any ideas on how to fill that void or another workflow that would do the same thing ? I think that running the workflow again would turn it back on as the actions are identical.

  • How can I use automator to open terminal change directory run a python script?

    Hi all,
    I dont really ever use automator - which may be my big problem - and I am trying to make an apllication that seems fairly simple in theroy. I want something that will lunch terminal, cd to the place where my python script lives and then run it. I have tried a number of suggested ways and can get the terminal to open and the directory to change but cant figure out how to run the script. This is my workflow if i did it manually each time
    - open terminal
    - type cd "the place where my file lives"
    - type python uploadr.py -d
    I can get terminal to open then cd to the right place but cant get the "python uploadr.py -d" to run without an error.
    any help would be very appricated
    thanks!!!
    J

    this is the script I got closest with - I know its something to do with breaking those two commands up but i just dont know how to do it
    on run {input, parameters}
              tell application "Terminal"
      activate
                        if (the (count of the window) = 0) or ¬
                                  (the busy of window 1 = true) then
                                  tell application "System Events"
      keystroke "n" using command down
                                  end tell
                        end if
                        do script "cd /Users/behole/Desktop/FlickrUpload/" & "python uploadr.py -d" in window 1
              end tell
              return input
    end run
    this is the error I get in terminal after I run it
    Last login: Mon Jul 23 15:37:17 on ttys000
    be-holes-MacBook-Pro:~ behole$ cd /Users/behole/Desktop/FlickrUpload/python uploadr.py -d
    -bash: cd: /Users/behole/Desktop/FlickrUpload/python: No such file or directory
    be-holes-MacBook-Pro:~ behole$

  • Is there a way to find out what computer was used to make an order

    I found some charges on my account that I did not make assuming that it was either my 14 year old son or soon to be ex-husband, is there a way to tell what computer was used to make the order?

    rbailey60 wrote:
    Last update was 3/3/2011 which was the itunes update. So the problem must be w/the itunes update. Does anyone know how we can contact MAC to tell them of this problem?
    It's highly doubtful there's a general problem caused by that update, or the forums would be full of similar posts. More likely, it's specific to your setup somehow.
    Have you Restarted your Mac lately? If not, that's always worth a try.
    Then, make sure there isn't a problem with the file system on your internal HD. Verify it, per #6 in [Formatting, Partitioning, Verifying, and Repairing Disks|http://web.me.com/pondini/AppleTips/DU.html] (or use the link in *User Tips* at the top of the +Using Snow Leopard+ forum).
    If that's ok, then as GfulDedFan says, run +*Repair Disk Permissions,+* per #5 there.
    If that doesn't help, try connecting to your router via Ethernet cable instead of wireless, to rule out interference problems.
    If you have the same results via Ethernet, you can make an appointment at the Genius Bar of your nearest Apple Store: http://www.apple.com/retail/geniusbar/
    Or call AppleCare at: (800) APL-CARE (800-275-2273)

  • Do I need to turn Mac book air off after I used OR just make it sleep......?

    Do I need to turn Mac book air off after I used OR just make it sleep......?

    No need to turn it off. Just put it to sleep.

  • How to make system update with "use automatic configuration script" and an URL

    Hello,
    all our laptop using "use automatic configuration script" with an "accelerated_pac_base.pac" prxy setting.
    How can we make system update work with that ?
    And no way for us to by pass this proxy settings with
    Thanks

    I mean there is no general method which is capable of correcting all possible errors found by schema validation.
    For example if the validation says it expected to find an <organization> element or a <company> element but it found a <banana> element, there is no way to determine what repair is necessary.
    Anyway the requirement is fighting against the way things work in the real world. The purpose of validation is just to find out whether a document matches a schema. If it doesn't, then too bad. Send it back to be fixed or replaced. If you are having a problem because you repeatedly get documents which don't quite match your schema, then you need to train the users to produce valid documents or to give them tools which help them do that.

  • Using Automator to create script

    What I'd like to do is use Automator to create a script that will open an image as soon as it is transferred to a specific folder. I'm trying to generate some extra income by doing a bit of photography. Since my photo gear is not wireless or bluetooth capable, I'm going to transfer the image from the camera to my MacBook via an Eye-Fi card. Once the image is transferred into the designated folder, I'd like the script to open the file in either Preview, Aperture, or Photoshop so I can see if I need to re-shoot the image. Is that possible? I'm just not sure how to do it in Automator. Thanks to all.
    -- Dennis

    Unless I misread your post this should be simple. The steps below are for the Snow Leopard version of Automator but will be similar for other versions. I had the test file open in Preview because I do not have Aperture installed but there should be a similar Automator action for it.
    1. Create the folder that you want to drop the photos into and put it in a convenient place. I used the Desktop.
    2. When the opening dialog appears choose Folder Action.
    3. When the next Automator window appears notice the drop down menu that allows you to choose a folder. Click here and choose the folder you created earlier.
    4. Find the Automator action "Open Images In Preview" and drop it into the window's right side as the only step/
    5. Save your work.

  • HT204074 I am using the same computer i used to make all my music downloads and when i try to re-download a song or album it already says "downloaded". i need to re-download because the backup was lost. my computer is still authorized on my account.

    I am using the same computer i used to make all my music downloads and when i try to re-download a song or album it already says "downloaded". i need to re-download because the backup was lost. my computer is still authorized on my account.

    If you still have the 'pointers' to them in the Music part of your iTunes library (i.e. where you would click on them to play them) then iTunes will assume that you still have them and will show them as downloaded in the Purchased link under Quick Links on the iTunes store home page - if you try deleting one of them then it should get the cloud symbol for re-downloading, and you can do the same for the others.

  • Using Automator to Batch Create PDFs

    I've been trying to find a way to make an Automator workflow that will take the name of a folder and combine it's files into a PDF with as little manual input as possible and have finally figured out how to do so. I've seen others ask how to do this for a while so I wanted to share how I did it.
    Why would you want to create PDFs? If you have scanned books, photos, documents or anything else on your Mac, you can create PDFs out of them. You can then store these in iTunes and either read them using Preview on your Mac or iBooks on your iOS device.
    What this workflow will do:
    Take a folder with images, get the folder's name, and create a PDF of the images with it's name.
    On the next pass of the workflow, it will send the previous folder to the trash.
    Create/have a backup of your files!
    Create a folder somewhere that you can drop your folders in. Name it Automator Dropbox. You can create one wherever you want, but this workflow was created with Automator Dropbox in mind so you'll need to change it as necessary.
    Open Automator and create a new workflow.
    Find Finder Items
    - Search Automator Dropbox
    - [All] of the following are true:
    - [Label] is [Red]
    This will search for any folders that were done before.
    Move Finder Items to Trash
    This will move the previous folder/files to the trash.
    Ask for Finder Items
    - Prompt: [Choose a Folder]
    - Start at: Automator Dropbox
    - Type: [Folders]
    This will ask you to choose the next item to convert to PDF.
    Set Value of Variable
    - Variable: pdfvariable
    This will take the name of the folder you just selected and use it to to rename your PDF.
    Label Finder Items
    - [Red]
    This will mark the folder you're working on for deletion the next time the workflow is ran.
    Get Folder Contents
    This will grab all the image files within the folder so that it can create a PDF out of them.
    Scale Images
    - To size (pixels): 1600
    This will scale the maximum dimension of your image down (or up) to 1600px. I find this to be the sweet spot for performance on the iPad 3, and it looks just fine. If the maximum dimension of your image is lower than 1600px, I'd create a duplicate workflow of this and leave out this step; otherwise you will be upscaling and your image won't look as good. You can also leave this step out if you want your original image size kept, but on the iPad 3 and below there will be a delay going from page to page.
    New PDF From Images
    - Save Output to: [Desktop]
    - Output File Name: tempname
    This will save your finalized PDF to the Desktop. You can change this to whatever you want; I would suggest the Automatically Add to iTunes folder located in [Music > iTunes > iTunes Media > Automatically Add to iTunes]. You will find your PDF in the Books category in iTunes.
    Rename Finder Items
    - [Replace Text]
    - Find: tempname in [Full Name]. Ignore Case checked.
    - Replace: [pdfvariable] (Drag pdfvariable from the variables window into the text field for "Replace". If you don't see the variables, go to "View > Variables."
    You can't just drag the variable into the PDF name field in the step above, so this extra step is necessary. It will rename your PDF with the name of the folder it was created from. It will also add the full file path, which will be taken care of in the next step.
    Rename Finder Items
    - [Replace Text]
    - Find: Users/yourname/Documents/Automator Dropbox in [Full Name]. Ignore Case checked.
    - Replace: LEAVE EMPTY
    This will delete the name of the path from the name of your PDF. If your working folder is not Documents/Automator Dropbox, change it to whatever that is.
    If you're running this workflow on a bunch of folders, you can simply keep your cursor over the workflow's play button and press the right arrow + enter to select the next item in queue. This workflow was made for using a little human interaction as possible, so if anyone has suggestions on how to improve on it please post below.
    One last thing - if you're seeing a red folder when you run the workflow to choose a folder, it's because spotlight hasn't indexed it yet and the workflow could not find it to delete it. Just go on to the next item.

    Someone (not me) has created an automator workflow that does this, using a shell script that runs the "pstopdf" unix command. I just downloaded it and tested it on 10 .eps files. You will need to edit the first automator action in the workflow to find the eps files you want (by default it looks for all eps files on your computer), but once you do that, it works like a charm! Converted my eps files to pdf's. Of course, once they are pdf files, you can use automator to convert them to whatever format you want.
    http://mad-sci.blogspot.com/2007/12/why-i-hate-computers.html
    (link to the actual zip file containing the workflow below)
    http://www.physics.mcgill.ca/~burkes/code/PDFworkflows.zip

  • Unmount dead hard disk on start up using automator

    I have a powerbook with a dead internal hard drive.
    I currently boot from a firewire drive just fine
    using a Carbon Copy Clone of the other drive.
    Just one problem: the hard drive clicks for about 15 minutes
    trying to work, and then gives up.
    I would like to create an applescript, or use automator,
    to automatically unmount the dead drive on startup,
    so that the system will stop trying to reference it
    and it will stop its accursed clicking.
    What is the default path to the internal hard drive?
    This is the best partial lead I have gotten so far, for unmounting an inappropriate volume; I am aware the syntax or path may be off.
    Also: Disk Utility does not find the dead drive... period.
    Thanks for any suggestions or solutions
    Mo Lohaus
    Partial Lead:
    Open up /Applications/Applescript/Script Editor, and enter this:
    do shell script "diskutil unmount \"/Volumes/WindowsPartition\""
    Replace WindowsPartition with the name of the partition that has Windows on it.
    Hit the Compile button, and then File -> Save As... -> Save as application.Save the newly created application somewhere, like /Applications.
    Then go to System Preferences -> Login items, and make the app a login item. Check the hide box and you won't see the icon in the dock.
    When you first log in after a restart, the partition will be mounted, but will unmount after about 10 seconds or so. Hopefully that is secure enough for your needs.

    You could visit the iFixit.com site and read through their guides
    on how to replace the hard disk drive in your computer, & do it.
    • PowerBook Repair - iFixit:
    http://www.ifixit.com/Browse/PowerBook
    Usually the PowerBook design is less difficult than the iBook
    when it comes to replacement of an internal hard disk drive.
    And I'm wondering, if you can use the X or other key on startup
    to find another boot volume on an external hard disk drive to
    run the computer from, to choose an alternative without having
    the internal failed hard drive clicking away all that time. Yet, to
    have the working external FW drive seen immediately by the
    PowerBook, seems well within reasonable reach.
    I've ran many computers from a clone or second system outside
    of the computer's case, using the System's startup disk panel to
    choose it. So, if the external is available to the computer, and it
    is seen correctly, the internal drive should not chatter or try to run.
    Replacement of the internal hard disk drive, of course, remains
    to be the ideal answer; as you undoubtedly realize. Perhaps
    the pressing nature of this will force you into taking the plunge.
    Good luck & happy computing!

  • How do I prevent computer sleep when on screen saver

    Hello,
    I have an early 2009 MacBook Pro (17 in.). Since installing Lion, I have a problem when my MBP stays on the screen saver for a while. (Arabesque). I have set my Energy Saver preferences so that when on power adapter, the MBP goes in Display sleep after an hour, but never goes in Computer Sleep.
    However, when I leave it like that for a while, the computer still goes to sleep.
    Does anybody know what I need to do to make it respect the Energy Saver preferences?
    Thanks,    Dan.

    Yes it's important to have both. Basically, I'm using third party
    software, a surveillance program to trigger Insteon and X10 portions of my
    home automation. The only way to do this on a motion detection event is to
    run an executable from that program, so I'm doing so by launching LV with
    the vi as the argument. The problem currently is that when the motion even
    occurs, the vi pops up for a split second and then runs in hidden mode.
    I
    did try the transparant thing, but it still grabs focus away from the current
    application. Wouldn't be an issue at all if the pc were dedicated to the
    security system, but it's used for other stuff too.
    I do have a fallback
    and that is to listen to UDP on assigned sockets from the surveillance program.
    I would prefer not because it's intended to be used only with the remote
    video playback client program and more importantly, if LV isn't running,
    then I'm SOL. Currently, the VIs that are launched do to camera activity
    also make sure through path and call references that the other parts of the
    system running is LV is running or launched if not.

  • How to resize and change the resolution of a batch of photos using Automator

    I searched for a long time tonight looking for the answer to this (seemingly) simple question:
    How do I use Automator to scale and change the resolution of a batch of images?
    It was not so simple.
    Links to this question:
    https://discussions.apple.com/message/12341246#12341246
    https://discussions.apple.com/message/12342026#12342026
    https://discussions.apple.com/message/5785047#5785047
    https://discussions.apple.com/message/1173358#1173358
    https://discussions.apple.com/message/5641853#5641853
    https://discussions.apple.com/message/3207516#3207516
    These are just the links on this site - I found them all over the place at MacRumors, Apple Tips, Mac Help, etc.
    You can actually manage this in Automator.
    Here are the steps that worked for me:
    Create an Automator APPLICATION - not a workflow (this is due to the way that I'm batch converting images - workflows might be ok for some cases)
    Step 1 is Copy Finder Items
    My flow inserts an SD card, opens the DCIM folder that my Nikon creates, selecting the images that I click (command + click to multi-select) and once I have the photos highlighted, I drag them onto this Automator App we're creating.
    <==  You'll have this guy soon!
    As a result - I want to copy the originals to my computer as step 1.  I don't touch the originals on the SD card (and cards are cheap so I tend to leave them on the cards as well)
    Step 2 is the Scale Images action - you can search the library for this and find it quickly.  For my part, I found that scaling images to about 38.8 percent of their size on the SD card is good for uploading to a blog.  Change this value to whatever you wish.
    Step 3 is Run Shell Script - and here is where we marry the brilliance found at this link with our script.If you have a hard time reading the text in the image, it is as follows:
    #bin/bash
    for f in "$@"
    do
         /usr/bin/sips -s dpiHeight 72.0 -s dpiWidth 72.0 $f
    done
    Save this application (I named mine "Format Photos")
    Place the application inside the target folder where you want the images to end up.  I do this because when I have the SD card window open, I can also open my "Photos" window and see my App sitting there.  I select my images as I mentioned and drag them on top of this app.  The app copies the originals and the conversions into the folder.
    NOTES: When you open a converted pic in Preview, you will see Resolution = 300 dpi if you go to Tools --> Adjust Size...  This reading is explained by another brilliant discussion as sips only touches the JFIF properties inside the file's MetaData.  However, if you look at the bottom of the Adjust Size... window, you'll see the image size is probably around 500 kb (give or take depending on the original).  My goal was to get the images down from the 3.0 MB I shoot at to around 500 kb.  Therefore even though the MetaData still thinks that it is 300 DPI according to Preview, it has been changed to 72 (open it in some other applications mentioned at the links and you'll find different readings - it all depends on what the application reads from the Meta).
    This does not rename the files, so you'll get DSC_1000.jpg and DSC_1000 copy.jpg in all likelihood.  If that annoys you, add a step into the Automator Application that renames the file after the "Run Shell Script" action has run, and you can have each file renamed according to some convention that you like.
    This took a heck of a lot longer than I expected - so I decided to put in the effort to share this with the community and save others the hassle. 

    PPI is pixels per inch of the image.  It is difficult to increase resolution as you are trying to add data that is not there.
    But for printing purposes what you want is dpi or dots per inch.
    The image processor either accessed from Bridge (tools/photoshp) or PS is a good way to change a batch of images.

  • Can i use Automator in app such as illustrator, Photoshop, Indesign?

    I want to use automator in illustrator. How can I use it?
    I tried to make services menu in illustrator cs5. but, It doesn't work.
    Simply explain one thing about illustrator. I want to make keyboard shortcut for file>script>script menu(this is what I want to make keyboard shortcut)
    I can make action for a script menu and defind keybosrd shortcut. It deserpeard after restart app.
    I tried to rocord "whatch me do" in illusrrator. but It doesn't work, either.
    How can I use Automator in illustrator?

    The short answer is this is not possible. 
    The long answer is Photoshop & Illustrator use print fonts installed on your system (True Type, Open Type, Post Script).
    Web fonts (ie: Google, TypeKit, Edge, etc...) need a web browser to display them because they use file types that are not recognized by other applications.  
    EOT Compressed
    EOT Lite (uncompressed)    
    TTF (raw TrueType Fonts for screen)
    SVG (xml version)
    SVGZ (gzipped version)
    WOFF (gzipped, web only, cross-browser font)
    Nancy O.

  • Using Automator to create a "video server"

    I'm looking to turn an Xserve into a video server for a digital signage situation. I know I can use Automator to open a video file in Quicktime and automatically play it full screen, however, is it possible to do the following with automator (or in some other easy fashion):
    1. Have it go into a designated folder and open up the video file in that folder no matter what the files name is. (So I can update the video content monthly and just copy the new file into the folder and not have to change anything in the Automator script. I could always give the file the exact same name every month, but it would be nice if I didn't have to.).
    2. Automatically run the Automator script on system boot - so we can boot up the Xserve in the morning with 1 button and once the OS is up it automatically starts playing the video file.
    3. Last, (and this is probably the hard one), any thoughts on a way I can get the server to play a file to its end, and then check and see if there is a newer file present before looping? If not, it continues looping the same file, if so, it begins looping the new file instead? I'm guessing this would be more of an Applescript thing than Automater? This would be for a "content update while playing" situation.
    I may not even mess with number 3, but the first two are a must. I'm not asking that you take time to develop working code for all the above, just letting me know that I can do it and whether I should be looking at Automater or Applescript for certain functionality would be fine and I can further research from there.
    Thank you.
    Don Hertz

    1. In the Finder actions you will need:
    - Get Specified Finder Items, and point it towards the folder that will contain the movie.
    - Get Folder Contents - to get what's inside the folder.
    - Filter Finder Items - set to filter by 'Name Extension' 'Is equal to' 'mov' and make sure all your video files have the right extension...
    - Open Finder Items - in QT Player - note that this might cause problems if there are multiple files in the folder...
    Then from the QT Player actions:
    - Play Movies.
    2. Save As... Application, then after saving, drag the app into the login items for the user account.
    3. That's going to need some AppleScript, but this thread should get you started:
    http://discussions.apple.com/thread.jspa?threadID=455825&tstart=0
    Ian

Maybe you are looking for