Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's probably doing the "opens this file using the appropriate application" instead of executing, and returns true because the file successfully opens (or is already open in its associated app). If I have a python script and do</p> <pre><code>f= new File("~/Documents/misc_scripts/getpixelrgb.py"); f.execute(); </code></pre> <p>, it opens it in my script editor, even if the file's execute flags are set.</p> <p>I'm on OSX, btw</p> <p>In After Effects, there is system.callSystem() to execute command line commands, but I'm afraid that is absent in Illustrator (I'm assuming you're doing this for Illustrator because of the tag). Are you on OSX or Windows? There are ways around this, by making an executable .app (OSX) or .exe (Win) and calling that with execute(). If I were doing this, I'm on OSX and I'd make an AppleScript app that does 'do shell script' to make the ruby system call. On Windows, it's different. One solution you might like if you're on windows: ocra, which is ruby-specific (<a href="http://ocra.rubyforge.org/" rel="nofollow">http://ocra.rubyforge.org/</a>). It may be possible to run a .bat file on Windows that calls the ruby script, but I'm not sure.</p> <p><strong>[edit!]</strong></p> <p>Terribly sorry for the extraneous Windows info (for someone else, I guess). Just saw your note about being on OSX. So you might want to use the AppleScript solution.</p> <p><strong>[edit again]</strong></p> <p>So, if my ruby script ("test.rb") is:</p> <pre><code>#!/usr/bin/env ruby print "Hello" </code></pre> <p>and my AppleScript is:</p> <pre><code>do shell script "cd /testing_folder/; ruby test.rb" </code></pre> <p>Then I get "Hello" returned in AppleScript, but ExtendScript will just return true.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload