終了

プラグインにおけるjsxファイルの変数のやりとりについて(ES3, ES2018の連携)

New Here ,
Apr 19, 2023 Apr 19, 2023

リンクをクリップボードにコピー

コピー完了

English follows japanese

 

CEPを用いたプレミアプロのプラグインの開発をしております。

jsxファイルを用いた関数の呼び出しを元に、

jsファイルで関数を動かしている状況です。

 

このとき、jsxファイルの関数Aの返り値の挙動が不明なので質問です。

 

jsxファイルの関数Aの返り値 resultA = "something"だとして、

jsファイルに引数として argumentB = resultAを用いれば、

argumentB = "something"が正しく渡されます。

しかし、関数Aの返り値が resultA = ["something", "anything", "hogehoge"]といった配列の場合、

jsファイルに引数としてresultAのうち、一個目の要素を取ろうと

argumentB = resultA[0]と定義すると、argumentB = "s"となり、

somethingのsが返ってくる状況です。

これが数字の配列だとしても、初めの1つの数字が返ってくる状況です。

 

jsxファイル内でのやりとりなら配列が渡せるのに、jsファイルに渡そうとするとこのような挙動となっております。

くどくなりましたが、質問としては、jsxファイルまわりの変数のやりとりでは、配列は使用できないのでしょうか?変数1つしか渡せないのでしょうか?

原因としてはECMAScript3のjsxとES2018の違いだと考えておりますが、この間の連携がよく理解できておりません。どなたかご教授のほどよろしくお願いします。

 

Hi, I'm writing code in CEP for Adobe PPRO.

My question is how the value is passed from jsx file to js file.

Actually, the value is not the problem, but the array has trouble.

Here is my situation.

As I write function A and it returns resultA = "something" as a string in jsx file, 

I can use argumentB in js file as a argumentB = resultA = "something".

However, using array as ["something", "Anything", "Hogehoge"],

My argumentB in js file is argumentB = resultA[0] = "s".

That means the first letter of "something" .

 

In the same jsx file, there is no problem in using array, but it has in above.

So I want to know how to use array in jsx file to pass js file. 

I think the reason of this problem is between ES3 in jsx and ES2018 in js.

But I'm not sure about everything on ES3. Please help me.

キーワード
SDK

表示

165

翻訳

翻訳

レポート

レポート
コミュニティガイドライン
他のユーザーへの思いやりを持ち、敬意を払いましょう。コンテンツの出典を明記し、投稿する前に内容が重複していないか検索してください。 さらに詳しく
community guidelines
no replies

何か追加しますか?

会話に参加する