Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects applecsript

  • applecsript

    Posted by Stephen Lawes on February 14, 2007 at 6:15 pm

    I often think that some of the simplest things can be the most annoying.
    Here is a prime example –
    I want to launch a specific ae script from an applescript, but the DoScript command seems to be looking at the file as a script rather than a file of a script. That’s sounds confusing so here’s the script –

    on open these_items
    tell application “Adobe After Effects 7.0”
    launch
    activate
    open these_items
    set thefile to “/Rocket_1_g5/Applications/Adobe After Effects 7.0/Scripts/DemoPalette.jsx”
    DoScript thefile
    end tell
    end open

    The error I get is –
    Unable to execute script at line 1.Expected:;

    I tried the version of the similar applescript on page 8 of the ae scripting guide which works just fine, but I don’t want the user to choose the file, I want to specify the file in the script.

    I would really appreciate any help,
    Thanks,
    Stephen.

    Stephen Lawes replied 19 years, 3 months ago 3 Members · 4 Replies
  • 4 Replies
  • Mylenium

    February 14, 2007 at 7:43 pm

    Have you tried to use escape characters (“\” or whatever they may be in AppleScript) around your file path? Could possibly help, though I’m just guessing.

    Mylenium

    [Pour Myl

  • Christopher R. green

    February 15, 2007 at 7:02 am

    Hi Stephen.
    Here’s the solution.
    I’m assuming these_items is a variable containing drag/dropped files in the finder (projects or footage items, perhaps).
    Realize that the DoScript command is an AppleScript command, and therefore expects the parameter to be either a (text) string of the script itself (like “alert(‘wow’);”, or a file specification of a script file. In AppleScript parlance, this means either a file specification (file file_path), and alias (alias file_path), or a file path string. The simplest form of this is probably a file path, but using Posix form (with the forward slashes and tricky characters in need of escaping) is not the default AppleScript way, so you use this format: “Rocket_1_g5:Applications:Adobe After Effects 7.0:Scripts:DemoPalette.jsx”, assuming Rocket_1_g5 is the hard drive name. You can also do something like:
    –(watch out for word wrap; this is one line:)
    tell application “Finder” to set theFile to (startup disk as text) & “Applications:Adobe After Effects 7.0:Scripts:DemoPalette.jsx”
    And anytime you want to get the correct file path, you just copy the results of running the “choose file” command. That’s what you should’ve done first to get the correct file path to paste into your script.
    You’re on your way …

    CG

  • Christopher R. green

    February 15, 2007 at 7:04 am

    [crgreen] “this means either a file specification (file file_path), and alias (alias file_path),”

    Sorry, that should read “a file specification (file file_path), an alias (alias file_path)” (not “and”)

  • Stephen Lawes

    February 15, 2007 at 8:04 am

    Guys, this is fantastic.
    I knew it had to be something simple, and jees, are those things frustrating when you don’t know what you’re looking for.
    Chris – Script works great now, thanks. By the way I’ve used your ‘comp to UI’ script many times. Comes in really handy.

    You know it’s really annoying that Adobe don’t integrate the whole scripting thing more thoroughly into ae – its so powerful. That, and the rather thin ae script guide. I think I’ve learnt more from breaking down your’s and other’s scripts than from that guide.
    On that note, I was looking for a way to connect a ‘dropdownbox’ UI command with some text entry the other day, and after much research – most from the ever useful aehancers website – I found the best info from the bridge script guide that listed all of its UI commands.
    Now why would I have to refer to the bridge script guide for ae UI commands ? Oh that’s right, its because the ae script guide doesn’t even cover that subject. Great.
    Anywho – rant over, I’ve had trouble getting that working since the bridge javascript seems a little different than ae’s, so there might be a follow up question in the near future.

    Again, many thanks,
    Stephen.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy