Salir
  • Comunidad global
    • Idioma:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티

How to set title for window at run-time for extension

Explorador ,
Jan 20, 2017 Jan 20, 2017

Hi,

I am using the following JavaScript to modify the title for current extension dialog (Modeless dialog):

      var csInterface;

      $(function () {

            csInterface = new CSInterface();

            csInterface.addEventListener(Events.Products.ImageBind, init);

      });

      function init(event) {

            csInterface.setWindowTitle("Images");

      }

        

I also tried using "new CSInterface().setWindowTitle("Article");" in init() function instead of "csInterface.setWindowTitle("Images");". But title is not modified.

Please guide me on how to modify dialog title.

The manifest.xml file has the following definition for extension:

<Extension Id="com.adobe.illustrator.ImageUI.dialog">

      <DispatchInfo>

        <Resources>

          <MainPath>./html/image.html</MainPath>

          <ScriptPath>./js/main.jsx</ScriptPath>

          <CEFCommandLine/>

        </Resources>

        <Lifecycle>

          <AutoVisible>true</AutoVisible>

          <Visible>true</Visible>

        </Lifecycle>

        <UI>

          <Type>Modeless</Type>

          <Menu>title</Menu>

          <Geometry>

            <Size>

              <Height>400</Height>

              <Width>450</Width>

            </Size>

          </Geometry>

          <Icons/>

        </UI>

      </DispatchInfo>

    </Extension>

Thank you

TEMAS
Scripts
2.5K
Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines

correct answers 1 respuesta correcta

Community Expert , Jan 29, 2017 Jan 29, 2017

Yes, ver.19.1.1 supports CSInterface version6.0 and not supposed that feature.

Traducir
Adobe
Comprometido ,
Jan 20, 2017 Jan 20, 2017

padmanabanp_IndCbe​, hi!

Are you try this simple code in main.js file?

(function() {

  'use strict';

  var csInterface = new CSInterface();

  init();

  function init() {

    themeManager.init();

    csInterface.setWindowTitle("Images");

  }

}());

And what of your Illustrator version?

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Explorador ,
Jan 22, 2017 Jan 22, 2017

Hi ,

   Thanks for your reply. I use it in a file named image.js and i use Illustrator CC 2015.1.1 (v 19.1.1) and  CSInterface - v6.1.0.

Also i have a doubt in the above code, what is the purpose of using "themeManager.init();" and how to initialize themeManager? Please reply. Thank you once again

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Community Expert ,
Jan 22, 2017 Jan 22, 2017

The themeManager method is included by CC Extensionbuilder for Brackets. You can reference below link:

http://bit.ly/QKWWYL

However, You can comment out it and test previouse code.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Explorador ,
Jan 26, 2017 Jan 26, 2017

Hi ,

Thanks for your reply. I gave a alert in CSInterface.js file as shown below:

CSInterface.prototype.setWindowTitle = function(title)

{

    alert(title);

    window.__adobe_cep__.invokeSync("setWindowTitle", title);

};

I call the setWindowTitle() to change the title "Image" to "Article".

                csInterface.setWindowTitle("Article");

The alert() displays the title but the title is not set for dialog. Can you please guide me on what could be the problem and how to rectify it.

Thank you

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Community Expert ,
Jan 26, 2017 Jan 26, 2017

I try to below and work fine:

new CSInterface().setWindowTitle("Call setWindowTitle Method test");

スクリーンショット 2017-01-27 14.21.41.png

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Explorador ,
Jan 27, 2017 Jan 27, 2017

Hi Ten A,

Thank you for replying. I am using Illustrator CC 2015.1.1(19.1.1) 64 bit and recently replaced CSInterface.js file from version 5.2 to v6.1.0. I updated in manifest.xml file to use version 6:

<?xml version="1.0"?>

<ExtensionManifest

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ExtensionBundleId="com.adobe.illustrator.xxxUI" ExtensionBundleVersion="1.0" Version="6.0">

  <ExtensionList>

    <Extension Id="com.adobe.illustrator.ImageUI.dialog" Version="1.0.0"/>

  </ExtensionList>

  <ExecutionEnvironment>

    <HostList>

      <Host Name="ILST" Version="19.0"/>

    </HostList>

    <LocaleList>

      <Locale Code="All"/>

    </LocaleList>

    <RequiredRuntimeList>

      <RequiredRuntime Name="CSXS" Version="6.0"/>

    </RequiredRuntimeList>

  </ExecutionEnvironment>

  <DispatchInfoList>

Is there any other thing i need to modify? kindly let me know. thank you.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Community Expert ,
Jan 27, 2017 Jan 27, 2017

AFAIK, That metihod supports up to ver.19.2.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Explorador ,
Jan 29, 2017 Jan 29, 2017

Hi Ten A,

I tried below sample but was not working:

Please guide me on how to upgrade from CSInterfsce v 5.2 to v6. Thanks a lot. I just replaced my CSInterface file for new version in my js folder of extension. Is there anything else i should update? Please reply. Thank you

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Community Expert ,
Jan 29, 2017 Jan 29, 2017

Unfortunately, You can't use CSInterface.js ver.6.2 with Illustrator ver.19.1. You should to update your Illustrator ver.19.1 to ver.19.2.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Explorador ,
Jan 29, 2017 Jan 29, 2017

Hi.... Im using CSInterface - v6.1.0 (not 6.2). Also i added an alert in CSInterface setWindowTitle function as below:

CSInterface.prototype.setWindowTitle = function(title)

{

    alert(title);

    window.__adobe_cep__.invokeSync("setWindowTitle", title);

};

The title is displayed in alert() but not dialog title is not updated. Is it because im using Illustrator v 19.1.1?

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Community Expert ,
Jan 29, 2017 Jan 29, 2017

Yes, ver.19.1.1 supports CSInterface version6.0 and not supposed that feature.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Explorador ,
Jan 29, 2017 Jan 29, 2017
MÁS RECIENTES

Thanks a lot Ten A,

I tested in updated Illustrator version (2015.3.1) and it is working fine now. Thank you.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines