AppleScript no longer works

Discussion in 'AppleScript' started by Ron Mittelman, Jun 26, 2015.

  1. Ron Mittelman

    Ron Mittelman New Member

    Joined:
    Jun 26, 2015
    Messages:
    1
    Likes Received:
    0
    I had a perfectly good automator script which has been working for a year or two, then it all of a sudden no longer works.
    The Automator script created a service so when I right-click on a file name, it copies it into a Backup folder off of whatever the current folder is, then renames it to include the date. This script was on my right-click context menu, but now it's gone.

    I know... there's an automator forum. But the automator script contains a step which runs AppleScript, so I thought this was a good place to start. This script now returns an error when I try to run it:
    Code:
    on run {input, parameters}
       
        tell application "Finder"
            set output to (container of item 1 of input) as alias
        end tell
        return output
    end run
    When I run this code, I get this error: "Can’t make «class ctnr» of item 1 into type alias."
    Item 1 of input was the file I right-clicked on, so I guess container is the folder.

    Can anybody suggest a better way to code this applescript part so it doesn't return a syntax error?
    Thanks...
     
    Ron Mittelman, Jun 26, 2015
    #1
    1. Advertisements

  2. Ron Mittelman

    Cory Cooper Moderator

    Joined:
    May 19, 2004
    Messages:
    4,406
    Likes Received:
    115
    Hello and welcome.

    We have a few folks here with some AppleScript/Automator knowledge, so hopefully they will chime in. You can also post this question at the following link - they have much more experience with all things Mac scripting:

    MacScripter

    C
     
    Cory Cooper, Jul 5, 2015
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. toivo
    Replies:
    1
    Views:
    808
    Egidio
    Dec 12, 2007
  2. Donald Hall
    Replies:
    0
    Views:
    206
    Donald Hall
    Jul 12, 2003
  3. llaassllaaass@gmail.com

    Spotlight no longer works on external drives

    llaassllaaass@gmail.com, Jun 4, 2006, in forum: Apps
    Replies:
    0
    Views:
    222
    llaassllaaass@gmail.com
    Jun 4, 2006
  4. Danny Parker
    Replies:
    0
    Views:
    213
    Danny Parker
    Feb 24, 2008
  5. Donald Hall

    Interarchy 5.0.1 - ftp disk no longer works

    Donald Hall, Jul 12, 2003, in forum: Communication
    Replies:
    0
    Views:
    215
    Donald Hall
    Jul 12, 2003
  6. Uncle Dave

    Airport Express no longer works after update

    Uncle Dave, Mar 29, 2008, in forum: Communication
    Replies:
    2
    Views:
    215
    Fred McKenzie
    Apr 2, 2008
  7. Marc Sauvage
    Replies:
    1
    Views:
    145
    Christopher Masi
    Apr 13, 2004
  8. j_mckitrick@bigfoot.com

    MacBook 'wake-up' taking longer and longer?

    j_mckitrick@bigfoot.com, Aug 4, 2006, in forum: Portables
    Replies:
    4
    Views:
    330
    Dave Seaman
    Sep 16, 2006
Loading...