Automating (scripting) in Mountain Lion - advice ?

Hi,
A number of years ago I had some programming routine work on Mac, but it has been a while now (for the elderly amongst us ... I extensively programmed in Pascal and in HyperCard ...)
Now I would like to do some scripting to automate some tasks in Mountain Lion. Example of the task is to have my MacMini check on a regular basis for the presence of shared drives (USB drives) connected to my TimeCapsule, and if these are not mounted to go and look for them and mount them (reason for this task is that my MacMini serves as media server to a.o. my AppleTV, and every now and then the drives are unmounted (reason is not clear to me).
Does anyone have some good reference material on how to program AppleScript ? (I assume this would be the tool to use ?)
Thanks in advance

You shouldn't need syntax etc, Automator is a step by step task manager. This is what Apple say about it:
Or see the Mac 101 help page here: http://support.apple.com/kb/HT2488
Hope this helps

Similar Messages

  • Applescript "Finder" scripts in Mountain Lion?

    So... back in the old days (Leopard, maybe?) there was a category of "Finder" scripts that included things like "Add to item name" and "Replace text in item name"... But those seem to be gone in Mountain Lion. I've seen a comment that suggested finding the scripts in an old OS and copying them over, but a) I don't have an old OS laying around and b) I don't even know if they would work if I could find them. 
    So I guess I have a two-part question:
    1) DOES anyone have those old scripts somewhere?
    2) Will they still work, or has AppleScript changed so much that they won't work anymore?
    It's not imperative, but I'd love to know the answers, because those scripts were really handy for things like deleting a long title name from a series images exported from a Quicktime movie (for example).
    Thanks all! 

    Sheesh, using Automator to do anything seems like a ridiculous amount of work, especially compared to these scripts. Fortunately, someone DOES still have them:
    http://www.geekymac.com/use-applescript-to-quickly-change-file-names-in-lion/
    Short-term testing says they all still work.  :-)

  • Faxing script from mountain lion

    Hey guys,
    I have a compatible telephone modem connected to my Imac running 10.8.1. I just want to easily be able to fax using it. I know that in 10.3 and 10.4 there use to be  a simple Print to Fax script which I cannot find anymore.
    Does anyone have that script or can suggest an easy way for me to achieve this.
    Thanks very much.

    benson1977 wrote:
    Excellent, thought as much. Did see somewhere that older versions MBP may have a problem.
    When the driver is released for my printer, is it easier to just reinstall Mountain Lion...will I have to pay again?
    You won't have to pay again, ML will be in the purchased section in the App Store, you can download it again.

  • Automator crashes in Mountain Lion

    Every time I run automator (MBP 15'' Unibody + OSX 10.8.1) it gives me the following crash report:
    Process:         Automator [92960]
    Path:            /Applications/Automator.app/Contents/MacOS/Automator
    Identifier:      com.apple.Automator
    Version:         2.3 (346)
    Build Info:      Automator-346000000000000~31
    Code Type:       X86-64 (Native)
    Parent Process:  launchd [152]
    User ID:         501
    Date/Time:       2012-09-14 14:59:05.575 +0100
    OS Version:      Mac OS X 10.8.1 (12B19)
    Report Version:  10
    Sleep/Wake UUID: 3972C400-05C8-47A2-B682-2DA91EB65D5B
    Interval Since Last Report:          173069 sec
    Crashes Since Last Report:           14
    Per-App Interval Since Last Report:  149 sec
    Per-App Crashes Since Last Report:   5
    Anonymous UUID:                      4FDF6456-6BF9-472A-B7C7-A681B51D1D32
    Crashed Thread:  0  Dispatch queue: com.apple.main-thread
    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Application Specific Information:
    objc[92960]: garbage collection is ON
    *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSIndexSet initWithIndexesInRange:]: Range {0, 9223372036854775808} exceeds maximum index value of NSNotFound - 1'
    terminate called throwing an exception
    abort() called
    Any help?

    First off, it's entirely possible that there are just three of you in the country having the problem; Idiosyncratic problems do occur, you know.  The three places I would look first with automator are:
    Preference files.  Keep in mind that individual actions sometimes keep their own preferences files, and any one of those can cause issues if it's corrupt.
    old third-party actions (stored in ~/Library/Automator/).  Because of automator's plug-in nature, a third-party action that is broken under mountain lion could conceivably crash automator.
    auto-opened windows.  if you have the 'restore windows' option turned on in System Preferences -> General, and automator is trying to reopen a window that contains a corrupt workflow, that could bollix things too.  try turning that option off to see what happens.
    also - FYI - this is a volunteer forum.  I suspect some of the people who hang out here are Apple employees, but they are not here *as* Apple employees, if you follow me. 

  • Running Periodic Maintenance Scripts in Mountain Lion

    Here's an oldie question that I think has been asked with every new version of Mac OS X.  If a user shuts down his Mac in the evening and restarts in at 7AM the next morning, do the three periodic maintenance scripts ever run in Mountain Lion?
    It's easy to run them manually in Terminal or even with with an Applescript that I wrote, but do they need to be run under the condition I posed above?
    Thanks.

    For those people stating that no one needs to run these scripts or that they're somehow dangerous, please reconsider before posting inaccurate things like that.
    I haven't seen anyone stating that the scripts are dangerous. Clearly, they aren't. They are, however, unnecessary if the system is rebooted every day. The only exception is the periodic daily script 100.clean-logs, which deletes symbolic links in /Library/Logs/CrashReporter to crash and panic reports in /Library/Logs/DiagnosticReports older than 60 days. The reports themselves are deleted by a different process. Conceivably, if this script didn't run for a long enough time, the boot volume might fill up with broken symlinks to deleted crash reports. How long would that take?
    Well, a symbolic link takes up 77 bytes of storage space. Storage devices, however, allocate space in minimum units of one sector, which is usually 512 bytes. Some of the newer 3 TB hard drives have a 4096-byte sector size. So let's make some worst-case assumptions. Your boot drive is 3 TB, and you have only 1% of that space free, which is 30 GB. You generate 100 crash reports a day -- those being only crashes of system processes, of course, not user processes, which are logged to a different place. So your volume is filling up with symbolic links at the rate of about 400 KB a day. At that rate, it would take only about 75 years to fill it up completely.
    So you're quite correct. If your system is always shut down -- not in sleep -- between the hours of 3:15 and 5:30 AM every day, you should manually run 100.clean-logs at least once every 75 years. Let's say once every 25 years, to be on the safe side. Thanks for pointing that out.
    Properly Maintain Macbook pro: Apple Support Communities

  • How can I use QT pro automator actions in Mountain lion?

    I am using mountain lion with 2012 late iMac and recently I bought QT pro.
    And I try to use automator actions with QT pro, but there are only actions for QT 10 player.
    How can I use QT pro actions in automator?

    I have the exact same problem.
    I have an US keyboard but when I press the button with tilde I get this: § or this ±
    This looks like british keyboard to me

  • "Where is Keychain Scripting?" Mountain Lion edition

    This came back to haunt me from the Lion days.
    I launch the newly renamed Contacts app, and within a few seconds a "Choose Application" dialog with the caption "Where is Keychain Scripting?" pops up. But this time, nothing is clickable - I get a Spinning Beachball of Death that forces me to kill Contacts.
    Any ideas on how to fix this?

    After removing the contents of folder "/Library/Address Book Plug-Ins/" the problem seems to have disappeared. I had a bunch of old things in there that I suppose aren't supported anymore.
    This seems to have fixed it!

  • How I can execute a user logout script in mountain lion?

    I've read that logouthook have been deprecated but I can't find how execute a logout script without this method.
    Anyone may help me?
    Regards
    Alessandro

    Hello baltwo,
    I've read these article yesterday but the first one is about the LoginHook that Apple, in the second article, says that are deprecated.
    The second article say to use launchd instead LoginHook and LogoutHook.
    I've tried to do this but launchd works (I think...) only to launch a login script with the option RunAtLoad.
    Nothing is specified with regard to the logout script.
    PS.
    Launchd with login script work only with restart but not with a shutdown and a power-on ... I'm investigating this behavior!!
    I'm sorry for my poor english.

  • Yosemite run "mount volumes" is not same as Mountain Lion

    I have a script to mount the shared folder from Windows server (named: servicedesk) as a volume in Yosemite iMac.
    -- -------begin script-----
    set loggedInUser to do shell script "whoami"
    tell application "Finder"
      try
      mount volume "smb://servicedesk/M"
      do shell script "ln -sf /Volumes/M/ ~/Desktop/M"
      end try
    end tell
    ----------End script--------
    When run the script on Mountain Lion 10.8.5 iMac, I can list the "M" when run the command in terminal: ls /Volumes/
    But when run the script on Yosemite iMac, It's show "servicedesk" instead "M" when run the command in terminal: ls /Volumes/
    I don't know why it is difference and can't do anything to create symlink to the Desktop now. Please help????
    Thank you,

    Thanks for your reply @Camelot
    Your reply is solved my question.
    But I'm still wondering why it is same the way of script done (in OS 10.10.1) with 2 targets: shared folder on iMac and shared folder on Windows. The script which "mount volume" on MAC is have expected result, Windows is not. Please see the picture to easier understand
    1/ "Idrive", is mapped from iMAC, "M" is mapped from WIndows
    2/ But when show the result in Terminal, "Idrive" can list, "M" doesn't but it's shown "servicedesk". The icon is also difference on the Desktop!!!
    much appreciate your comments

  • OSX Mountain Lion says not compatible when it is. Advice please.

    Hi.
    i am running OSX Lion 10.7.5 and waht to upgrade to mountain lion.
    i purchased this on my macbook via the app store and it downloaded no problem but when i go to download it on my mac pro tower its says the following....
    "We could not complete your purchase. OS X Mountain Lion is not compatible with this computer."
    my house mate installed it on his mac pro and his is an older version than mine, i think mine is a 2009 model.
    Model Name:          Mac Pro
      Model Identifier:          MacPro1,1
      Processor Name:          Dual-Core Intel Xeon
      Processor Speed:          2.66 GHz
      Number of Processors:          2
      Total Number of Cores:          4
      L2 Cache (per Processor):          4 MB
      Memory:          5 GB
      Bus Speed:          1.33 GHz
    so i am looking for advice on how to fix this so i can upgrade to mountain lion....
    i hope some one can help soon
    Dan.

    boomboom1980 wrote:
    i produce music so like to upgrade all the time as eventually people stop upgrading the drivers....
    i think mine is a 2009 model.
    Model Name:          Mac Pro
      Model Identifier:          MacPro1,1
      Processor Name:          Dual-Core Intel Xeon
      Processor Speed:          2.66 GHz
      Number of Processors:          2
      Total Number of Cores:          4
      L2 Cache (per Processor):          4 MB
      Memory:          5 GB
      Bus Speed:          1.33 GHz
    MacPro 1.1 is a 2006 Model

  • After upgrading to Mountain Lion I am not able to access "security and privacy" button under "system preferences". I like to activate "find my mac" but cannot access privacy setting after upgrade. Kindly advice.

    After upgrading to Mountain Lion I am not able to access "security and privacy" button under "system preferences". I like to activate "find my mac" but cannot access privacy setting after upgrade. Kindly advice.

  • HT1222 hi i have a apple imac 27 2009 and i have purchased mountain lion but near the end it says An error occurred while running scripts from the package "mzps6175750011235388779.pkg"

    hi i have a apple imac 27 2009 and i have purchased mountain lion but near the end it says An error occurred while running scripts from the package “mzps6175750011235388779.pkg”
    can you please advise me what should i do to fix this

    Some ideas.
    https://discussions.apple.com/message/20034600#20034600

  • Late 09 MB Pro 13" now on Mountain Lion keeps crashing (spinning wheel) and getting VERY hot. Even Safe Mode slow to work. Managed a back up last night and wondering should I put the original ios disc back in to take it back to SL. Advice appreciated!

    Hi
    For past year or so my mac book has been getting gradually worse. Spinning wheel, and overheating, last night I had trouble just getting it to start in Safe Mode (been using the on/off button a lot lately!)
    Problem may be related to media - iMovie followed by iPhoto are the most likely programs to bring everything to a stop but not always.
    I'm not an expert although I did figure out how to re install the operating system from the partition with help from this forum a couple of months ago but it didn't fix the problem.
    The iOS is Mountain Lion (via Lion)
    I managed to do a back- up last night and now wondering if I should re- install Snow Leopard from the original discs that came with the laptop. 
    Got a lot of media on there (replaced the 250gb drive with a  Samsung 1tb a while back which is less than half full.
    Never had to use any of my back-ups before so:
    If I re install the original operating system will I be able to be selective in what I put back on later?
    and -
    Will there be any issues putting a Mountain Lion back-up into a Snow Leopard iOS?
    A lot of whats there isn't needed but don't want to lose it completely.
    Advice appreciated thanks

    Back up all data immediately as your boot drive may be failing.
    If you have more than one user account, these instructions must be carried out as an administrator.
    Triple-click anywhere in the line below on this page to select it:
    syslog -k Sender kernel -k Message CReq 'GPU|I/O' | tail | open -ef
    Copy the selected text to the Clipboard (command-C).
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V).
    The command may take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear.
    A TextEdit window will open with the output of the command. Normally the window will be empty. If you get output like this:
    kernel[0] <Debug>: disk0s2: I/O error
    the boot drive is failing, or there's some other hardware fault in the storage subsystem.
    If you get output like this:
    kernel[0] <Debug>: ** GPU Debug Info Start **
    kernel[0] <Debug>: ** GPU Debug Info End **
    there's a fault in the graphics processor or logic board. The two kinds of output are not mutually exclusive, but if you get both, a logic-board fault is likely.

  • Mountain Lion brings bugs and breaks Automator Services

    Just love this Automator tool, been using it to make my Finder dance for a while now.  My fresh install (Erase/USB) of Mountain Lion seems to be reproducibly broken for adding Services, and also appears to have a bug for editing existing Services...
    My steps to failure were as follows:
    Open Automator
    Select and choose "Service" to create a new service
    Find/drag "Get Selected Finder Items" to the service pane
    Find/drag "Launch Application" to the service pane
    Select the desired program/application (in this case a AppleScript.app)
    Change the "Service receives selected" to "Files or Folders", and change "in" to "Finder"
    Select the "Workflow" -> "Run" option to verify that the workflow actually works…  (Note: my Applescript applicaiton needs me to actually select a image file in Finder to properly operate...  But it works just fine in this step).
    Save the new Automator's service workflow (saves to ~/Library/Services as "Convert selected image" - (actually, any name produces the same failure mode.
    Close the new workflow document in Automator
    Verify that the Service exists (is installed) in "~/Library/Services/Convert selected image.workflow"
    Open a new Finder window,
    Ctl-Click on any file or folder, select the Services fly-out context menu: BROKEN: The expected Finder context service text of "Convert selected image" is not available.
    Verify that the Service exists (is installed) in "~/Library/Services/Convert selected image.workflow"
    Go back to Automator, select "File" -> "Open Recent"
    Select the recent "Convert selected image" file, up pops a new "Service Installer" dialog
    Selecting "Open with Automator" works as expected, the file opens in Automator
    Selecting "Cancel" works as expected, nothing happens
    Selecting "Install" in the "Service Installer" dialog pops-up a new dialog warning that the service is already installed, asking if we want to replace it (warning: replacing will overwrite the current file!)
    Selecting "Cancel" works as expected, nothing happens
    Selecting "Replace" pops-up a funky new dialog that warns "Installation failed" because: "Convert selected image.workflow couldn't be moved to "Services" because either the former doesn't exist, or the folder containing the latter does't exist".  Two options are offered: "Open with Automator" or "Done"
    BUG: Selecting "Open with Automator" fails as the "Replace" option in step 21 has DELETED the workflow from the ~/Library/Services folder and it no longer exists…
    Selecting the only remaining option of "Done" returns the duped user to the now empty and lonely Automator.
    Perhaps it's just me (or solar flares)...  Any ideas on how to get my Mountain Lion's malfunctioning (and lonely) Automator Services working again ?
    Thanks in advance.

    Hello!
    There are many more bugs.
    One such...
    For Example, When I enter the actions:
    Action 1. Get specified Finder Items
    (Two excel Files in the list)
    Action 2. Move Finder Items to Trash
    Automator moves the two excel files, AND other files previously created in the workflow to the trash.
    That is new to me.

  • Problem install Jdev on OSX Mountain Lion, please advice

    Hi all,
    I have been trying to install JDeveloper Suite 121200 on my MacBook Air running OSX 10.8.5 Mountain Lion for a couple of days but have not succeeded.
    I have read every install guide I've been able to find, but still haven't been able to make it work.
    Does anybody have any advice for me, I really need to install this to be able to do the assignments we get from school.
    Thanks in advance,
    Kristoffer

    Hi,
    just installed the same yesterday with no problem. Make sure you download the Generic Installer (aka the JAR installer). Then install Java 7 to your MAC and ensure its the default Java version (type java -version on the terminal). Then call java -jar <jdeveloper install file name>.jar from the directory you copied the downloaded files to (by default this is called "Download"). Wait for the installer to pop up (may take a minute) and then install JDeveloper. The install directory then has a JDeveloper / JDev folder that contain the start icon to use for starting the IDE
    Frank

Maybe you are looking for

  • I'm no longer able to sync...  Does anybody have any suggestions?

    Hi Everybody! I have a MacBook Pro with Snow Leopard.  I also have a Verizon Wireless iPhone 4.  I tried to sync this evening for the first time in months....and iTunes won't acknowledge my iPhone.  "Devices" won't come up.  I tried using a different

  • Problem in creating dynamic array field.

    Hi there, Following are the steps we followed to dynamically build the array field. 1) Single column array field created with a single widget in the design time. 2) Few more columns were added using 'Addcolumn' method. 3) Data in the array object map

  • Battery

    Hi I've a problem with battery (4 cell) of my HP G62 I used the program HP Total Care to see which problem may have the battery. It display me "Recalibrate". I've seen there is a cell empty without current inside. I read this but the problem hasn't b

  • How to change my country without giving credit card info

    I want to be on the American market

  • Message sent to another iphone is not blue

    Why is message sent from an iphone to another iphone no longer blue, but now green?