• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to write script calling with parameter [CS6-js (Mac)]

Explorer ,
Feb 26, 2013 Feb 26, 2013

Copy link to clipboard

Copied

I'm doing script for produsing some sound:

var mString = "tell application \"Play Sound\"\rplay \"Mac:Users:a.ivanov:Sounds:" + "copied.wav" + "\"\rend tell"

app.doScript(mStrtest, ScriptLanguage.applescriptLanguage);

This work well.

Now, i'd like to call this script from other script with any desired wav-file (not only "copied.wav" )). How to write down correctly calling other script with param.

Thanks

TOPICS
Scripting

Views

796

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 26, 2013 Feb 26, 2013

Copy link to clipboard

Copied

Hi;

indesign cs 6 scriptingguide page 16 😉

http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/indesign/sdk/cs6/scripting/InDe...

P.S: you may also use MacOs builtIn afplay to play soundfiles 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 27, 2013 Feb 27, 2013

Copy link to clipboard

Copied

Page 16, as i understand, says about using doscript, but not calling other file. More over - i can't get worked this ScriptingGuide-example (pure copy-pasted in ESTK and don't work)

And "afplay" my Mac doesn't have (spotligth don't see it).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 27, 2013 Feb 27, 2013

Copy link to clipboard

Copied

Hi,

var myParameters = ["Mac:Users:a.ivanov:Sounds:", "copied.wav"];

var myAppleScript = "tell application \"Play Sound\" to play  ((item 1 of arguments) & item 2 of arguments)";

app.doScript(myAppleScript, ScriptLanguage.applescriptLanguage, myParameters);

doScript also excepts file, so if wanted save the line myAppleScript as *.jsx and insert the Filereference in the doScript

P.S. Assume MacOsx prior 10.5 may not include afplay

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 28, 2013 Feb 28, 2013

Copy link to clipboard

Copied

LATEST

-hans-,

thanks, now, with this way it workes! )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines