6 Replies Latest reply on Jun 20, 2016 4:19 PM by Kevin Parrott

    Illustrator Script Auto refreshing using timer

    karthickm50893796 Level 1

      How to run a script in timing base. for example i want to run a script 24/7 with out double click.. below attach its just a rough sketch of what i think!!Screen Shot 2016-06-14 at 3.41.36 PM.png

       

      when i paste my completed files to conversion folder then .PNG Conversion script need to run automatically, if there no files in conversion folder the .PNG Conversion script should stop .... Script need to active when System on..

        • 1. Re: Illustrator Script Auto refreshing using timer
          Kevin Parrott Level 2

          try using on idle script

           

          something like this should get you started

           

          on idle

               set FolderPath to alias "Path to conversion folder"

              set ConVert_Folder to (FolderPath) as alias

             

              -- DO YOUR THING --

             

             

              tell application "Finder"

                  move items of ConVert_Folder to folder "Path to output folder" with replacing

              end tell

             

              return 600 -- come back and do it again in 10 minutes (adjust as necessary)

          end idle

          • 2. Re: Illustrator Script Auto refreshing using timer
            karthickm50893796 Level 1

            Kevin Parrott wrote:

             

            try using on idle script

             

            something like this should get you started

             

            on idle

            set FolderPath to alias "Path to conversion folder"

            set ConVert_Folder to (FolderPath) as alias

             

            -- DO YOUR THING --

             

             

            tell application "Finder"

            move items of ConVert_Folder to folder "Path to output folder" with replacing

            end tell

             

            return 600 -- come back and do it again in 10 minutes (adjust as necessary)

            end idle

            Hi  Kevin Parrott

            Thanks for your fast and furious reply,

            I just try this method ( did i want to save this a application format )

            your commands please

             

            set FolderPath to alias "Macintosh HD:conversion folder"

            set ConVert_Folder to (FolderPath) as alias

             

             

            tell application "Finder" to set fileName to name of theFile

             

            tell (info for theFile) to set {_Name, _Extension} to {name, name extension}

            set fileName to text 1 thru ((get offset of "." & _Extension in _Name) - 1) of _Name

             

            set fullPath to (saveLocation & fileName)

            set extension to "_HQPNG.png"

            set VectorPath to fullPath & extension

            tell application "Adobe Illustrator"

            open theFile without dialogs

            activate

            export current document to file VectorPath as PNG24 with options {class:PNG24 export options, transparency:true, horizontal scaling:416.67, vertical scaling:416.67, saving as HTML:false}

            end tell

             

            tell application "Finder"

            move items of ConVert_Folder to folder "Macintosh HD:output folder" with replacing

            end tell

             

            return 10

            end idle

             

            Thanks

            Karthick

            • 3. Re: Illustrator Script Auto refreshing using timer
              Kevin Parrott Level 2

              sorry, save as an application, stay open after run handler

              • 5. Re: Illustrator Script Auto refreshing using timer
                karthickm50893796 Level 1

                Hi Kevin Parrott

                 

                please check below script in your system pls

                 

                set FolderPath to alias "Macintosh HD:conversion folder"

                set ConVert_Folder to (FolderPath) as alias

                 

                 

                tell application "Finder" to set fileName to name of theFile

                 

                tell (info for theFile) to set {_Name, _Extension} to {name, name extension}

                set fileName to text 1 thru ((get offset of "." & _Extension in _Name) - 1) of _Name

                 

                set fullPath to (saveLocation & fileName)

                set extension to "_HQPNG.png"

                set VectorPath to fullPath & extension

                tell application "Adobe Illustrator"

                open theFile without dialogs

                activate

                export current document to file VectorPath as PNG24 with options {class:PNG24 export options, transparency:true, horizontal scaling:416.67, vertical scaling:416.67, saving as HTML:false}

                end tell

                 

                tell application "Finder"

                move items of ConVert_Folder to folder "Macintosh HD:output folder" with replacing

                end tell

                 

                return 10

                end idle

                 

                Thanks | Karthick

                • 6. Re: Illustrator Script Auto refreshing using timer
                  Kevin Parrott Level 2

                  your code will fail because the variable theFile at the beginning has nothing to reference to, you'll also need

                  to put in a repeat loop to go through all files etc.