5 Replies Latest reply on May 27, 2014 2:07 PM by CarlosCanto

    "Type Options" in "Document Setup" scriptable?

    Brian2025

      I would like to create a script (have not done one before) that changes the values of the superscript and subscript size/position in "Document Setup". After looking around, I did not see anything even related to this and only a comment on one site that it probably could not be done. So it this a lost cause? I have many files I would like to convert the values for.

       

      Thanks.

        • 1. Re: "Type Options" in "Document Setup" scriptable?
          CarlosCanto Adobe Community Professional & MVP

          I didn't find a way to change it either, if you're on windows "send keys" is always an option

          • 2. Re: "Type Options" in "Document Setup" scriptable?
            Brian2025 Level 1

            I am on windows and tried SendKeys. I am pretty close, but the CNTRL and ALT modifiers don't seem to work. It works in notepad and Word, but Illustrator does not seem accept the modifier. For example, I try to just do a select all here (via WshShell.SendKeys "^a") but it just goes to the direct select tool (keyboard shortcut "a") instead.

             

            I just created and executed a test.wsf file:

             

               <job id="vbs">

                  <script language="VBScript">

                    ' Open Illustrator

                    Set WshShell = CreateObject( "WScript.Shell" )

                    WshShell.Run "Illustrator"

                           

                           For testing purposes, Word does the select all correctly

                            'WshShell.Run "WinWord"

             

                    ' Give two seconds to load/observe

                    WScript.Sleep 2000

             

                    'Activate Select Tool

                    WshShell.SendKeys "V"

                   

                    'Activate Pen Tool

                    WScript.Sleep 2000

                    WshShell.SendKeys "P"

                   

                    'Select All

                    WScript.Sleep 2000

                    WshShell.SendKeys "^a"

             

                  </script>

               </job>

            • 3. Re: Re: "Type Options" in "Document Setup" scriptable?
              CarlosCanto Adobe Community Professional & MVP

              I couldn't make Ctrl work either, but this works, save as vbs and run inside Illustrator

               

              this changes the superscript default value of 58.3 to 60

              Set objShell = CreateObject("WScript.Shell")
              
              objShell.SendKeys "%F"
              objShell.SendKeys "D"
              objShell.SendKeys "%P"
              objShell.SendKeys "60"
              objShell.SendKeys "{ENTER}"
              
              • 4. Re: Re: "Type Options" in "Document Setup" scriptable?
                Brian2025 Level 1

                This works too. Thanks. Though it was strange. On my end the "%P"  command cause the units to change to pixels instead of tabbing to the right position. But that is OK since I just inserted a series of tabs.

                It looks like the real problem is that the CNTRL function does not work, which the ALT does. So you found a clever way to get around that. I think I will still use the SendKeys approach as I did in the 3rd post (but using ALT like you did). The reason is that is it easier to launch the script by just double clicking instead of picking it form a drop down menu.

                 

                Anyway, thanks for the tip! This is will work great.

                • 5. Re: "Type Options" in "Document Setup" scriptable?
                  CarlosCanto Adobe Community Professional & MVP

                  I tested with CS6 and I got the same problem, %P does not work. Previously I was working with CS5, it works fine there, Tabbing your way to your destination is a good alternative.