Highlighted

How to switch off SuperScript in InDesign

Community Beginner ,
Apr 27, 2020

Copy link to clipboard

Copied

Hi, 

How can I switch off SuperScript in VB ? 

AdobeInDesignApp.ChangeTextPreferences.Superscript = False is now working

 

 

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

The following code works for me 

Set myInDesign = CreateObject("InDesign.Application")
myInDesign.FindTextPreferences = idNothingEnum.idNothing
myInDesign.ChangeTextPreferences = idNothingEnum.idNothing
myInDesign.FindTextPreferences.FindWhat = "0000"
myInDesign.ChangeTextPreferences.Underline = False
myInDesign.ChangeTextPreferences.Position = idPosition.idNormal
myInDesign.Documents.Item(1).ChangeText
myInDesign.FindTextPreferences = idNothingEnum.idNothing
myInDesign.ChangeTextPreferences = idNothingEnum.idNothing
myInDesign.FindTextPreferences = idNothingEnum.idNothing
myInDesign.ChangeTextPreferences = idNothingEnum.idNothing

 

The issue was that you were using the wrong enum for normal, it was popping an error for the same which i fixed and it worked.

 

-Manan 

TOPICS
Bug, How to, InCopy workflow, Scripting

Views

627

Likes

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

How to switch off SuperScript in InDesign

Community Beginner ,
Apr 27, 2020

Copy link to clipboard

Copied

Hi, 

How can I switch off SuperScript in VB ? 

AdobeInDesignApp.ChangeTextPreferences.Superscript = False is now working

 

 

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

The following code works for me 

Set myInDesign = CreateObject("InDesign.Application")
myInDesign.FindTextPreferences = idNothingEnum.idNothing
myInDesign.ChangeTextPreferences = idNothingEnum.idNothing
myInDesign.FindTextPreferences.FindWhat = "0000"
myInDesign.ChangeTextPreferences.Underline = False
myInDesign.ChangeTextPreferences.Position = idPosition.idNormal
myInDesign.Documents.Item(1).ChangeText
myInDesign.FindTextPreferences = idNothingEnum.idNothing
myInDesign.ChangeTextPreferences = idNothingEnum.idNothing
myInDesign.FindTextPreferences = idNothingEnum.idNothing
myInDesign.ChangeTextPreferences = idNothingEnum.idNothing

 

The issue was that you were using the wrong enum for normal, it was popping an error for the same which i fixed and it worked.

 

-Manan 

TOPICS
Bug, How to, InCopy workflow, Scripting

Views

628

Likes

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
Apr 27, 2020 0
Adobe Community Professional ,
Apr 27, 2020

Copy link to clipboard

Copied

What do mean by switiching off the superscript. Do you want to remove superscript on a text that you found using the find/change feature? If that is so then you are targetting the wrong property, there is no property named superscript, but it is postion that can be set to superscript or any other permissible value with normal being the one that will make the text as normal. Look at the following for description on all the properties in the changeTextPreferences object

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#ChangeTextPreference.html

 

So the code that should work for you would be something like

 

AdobeInDesignApp.ChangeTextPreferences.position = Position.NORMAL

 

 P.S. :- I don't have access to a WIN machine so please verify the case of the property and enumeration as it works in VB

 

Likes

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
Reply
Loading...
Apr 27, 2020 1
Community Beginner ,
Apr 27, 2020

Copy link to clipboard

Copied

HI, this code 

   AdobeInDesignApp.ChangeTextPreferences.Position = Position.NORMAL

is not working 😞 I mean it is not removing SuperSript ;(  

smolar22_0-1587985496929.png

Do you have different option? 

Likes

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
Reply
Loading...
Apr 27, 2020 0
Community Beginner ,
Apr 27, 2020

Copy link to clipboard

Copied

Script is here : I want to remove SuperScript from text. Yes you are right. 

 

   AdobeInDesignApp.FindTextPreferences = idNothingEnum.idNothing
                    AdobeInDesignApp.ChangeTextPreferences = idNothingEnum.idNothing
                    AdobeInDesignApp.FindTextPreferences.FindWhat = "0000"
                  '  AdobeInDesignApp.ChangeTextPreferences.FontStyle = "Regular"
                  '  AdobeInDesignApp.ChangeTextPreferences.SuperscriptPosition = 0
                   ' AdobeInDesignApp.ChangeTextPreferences.SuperscriptSize = 0
                    AdobeInDesignApp.ChangeTextPreferences.Underline = False
                    AdobeInDesignApp.ChangeTextPreferences.Position = Position.NORMAL
             '       AdobeInDesignApp.ChangeTextPreferences.SmartTextReflow = False
               '     AdobeInDesignApp.ChangeTextPreferences.TypographerQuotes = False
                '    AdobeInDesignApp.ChangeTextPreferences.UseOpticalSize = False
                 '   AdobeInDesignApp.ChangeTextPreferences.UseParagraphLeading = False
                  '   AdobeInDesignApp.ChangeTextPreferences.ZOrderTextWrap = False
                    AdobeInDesignApp.Documents.Item(1).ChangeText
                    AdobeInDesignApp.FindTextPreferences = idNothingEnum.idNothing
                    AdobeInDesignApp.ChangeTextPreferences = idNothingEnum.idNothing

 

 

Likes

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
Reply
Loading...
Apr 27, 2020 0
Adobe Community Professional ,
Apr 27, 2020

Copy link to clipboard

Copied

I don't have access to a WIN machine to verify the code you shared, i have an idea that could help you debug the issue. Run your code with the last two lines commented out, specifically the lines given below

AdobeInDesignApp.FindTextPreferences = idNothingEnum.idNothing
AdobeInDesignApp.ChangeTextPreferences = idNothingEnum.idNothing

What this will do is keep the find/change setting your applied still persisted. After that you can open the Find/Change dialog and see if all properties are set as you desired, then you can even run the change using the dialog to see if these settings indeed does find something.

 

Likes

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
Reply
Loading...
Apr 27, 2020 0
Community Beginner ,
Apr 27, 2020

Copy link to clipboard

Copied

Hi, I am using it.

 

I also have in script to remove Underline and it is working correctly.

 

AdobeInDesignApp.FindTextPreferences = idNothingEnum.idNothing
AdobeInDesignApp.ChangeTextPreferences = idNothingEnum.idNothing 
AdobeInDesignApp.ChangeTextPreferences.Underline = False
AdobeInDesignApp.ChangeTextPreferences.Position = Position.Normal
AdobeInDesignApp.Documents.Item(1).ChangeText
AdobeInDesignApp.FindTextPreferences = idNothingEnum.idNothing
AdobeInDesignApp.ChangeTextPreferences = idNothingEnum.idNothing

 

Only problem with SuperScript

Likes

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
Reply
Loading...
Apr 27, 2020 0
Adobe Community Professional ,
Apr 28, 2020

Copy link to clipboard

Copied

Did you try to debug the issue as i mentioned, were you able to find or change the superscript using the Find/Change dialog with the same settings that you are using from the script?

Can you share the InDesign document which has this issue? Also is there any specific reason to use VBScript, JS would work on both a MAC as well as WIN machine

 

-Manan

Likes

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
Reply
Loading...
Apr 28, 2020 0
Community Beginner ,
Apr 28, 2020

Copy link to clipboard

Copied

I am using VBA excel, so in Debug I can only see on Adobe InDesing in realtime. 

So as I mention, Underline is removing correctly from InDesign, but SuperScript is not working. Nothing is changing.

I am using VBA Excel, because input data are in Excel - prices to udpate which comes from another tool ( it is exported to excel) so it is why I am using. So as I mentiond Underline=False causes removing underling from text in InDesign, so it is working, only problem with this position. Do you need something more ? 

                    AdobeInDesignApp.FindTextPreferences = idNothingEnum.idNothing
                    AdobeInDesignApp.ChangeTextPreferences = idNothingEnum.idNothing
                    AdobeInDesignApp.FindTextPreferences.FindWhat = 
                    AdobeInDesignApp.Documents.Item(1).TextFrames.Item(ix).contents

                    AdobeInDesignApp.ChangeTextPreferences.Underline = False
                    AdobeInDesignApp.ChangeTextPreferences.Position = Position.Normal
     
                    AdobeInDesignApp.Documents.Item(1).ChangeText
                    AdobeInDesignApp.FindTextPreferences = idNothingEnum.idNothing
                    AdobeInDesignApp.ChangeTextPreferences = idNothingEnum.idNothing
                

 

Likes

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
Reply
Loading...
Apr 28, 2020 0
Adobe Community Professional ,
Apr 28, 2020

Copy link to clipboard

Copied

Give me a sample InDesign document, upload it on dropbox or similar cloud service and paste the public link here. I will have a look and see if i can spot the issue

 

-Manan

Likes

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
Reply
Loading...
Apr 28, 2020 0
Community Beginner ,
Apr 30, 2020

Copy link to clipboard

Copied

Here you can find inDesign file and excel with Macro 

 

Please let me know or maybe send email to you or different contact so I can show you more details/

There is a problem with removing SuperScript

Likes

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
Reply
Loading...
Apr 30, 2020 0
Adobe Community Professional ,
Apr 30, 2020

Copy link to clipboard

Copied

I tried a translation of your code in JS on the dicument you supplied and i see you have used properties in changeTextPreferences that don't exist. You should have got a code crash, if you had told that we could have figured this out early. Removing these lines the code works. Remove the following line from your code and see if it works or not

//app.changeTextPreferences.superscriptPosition = 0
//app.changeTextPreferences.superscriptSize = 0
//app.changeTextPreferences.smartTextReflow = false
//app.changeTextPreferences.typographerQuotes = false
//app.changeTextPreferences.useOpticalSize = false
//app.changeTextPreferences.useParagraphLeading = false
//app.changeTextPreferences.zOrderTextWrap = false

 -Manan

Likes

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
Reply
Loading...
Apr 30, 2020 0
Community Beginner ,
Apr 30, 2020

Copy link to clipboard

Copied

HI, you can see that in code I have it commented, so it is not used in code 😞

I think it is not a cause 😞 

Likes

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
Reply
Loading...
Apr 30, 2020 0
Most Valuable Participant ,
Apr 30, 2020

Copy link to clipboard

Copied

You can help Manan help you by supplying as much useful information as possible...

"There is a problem" may be a perfectly correct description of what you are seeing but it doesn't really tell us anything useful at all.

Likes

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
Reply
Loading...
Apr 30, 2020 1