10 Replies Latest reply on Aug 31, 2014 7:01 AM by David André Erichsen

    Document font

    David André Erichsen Level 1

      Hello.

       

      [AS]
      Can anyone make a script that make a folder called "Document Fonts" at the same location as the .indd-file, ant copy all used fonts into that folder?

      That would be very nice to have!

        • 1. Re: Document font
          Larry G. Schneider Adobe Community Professional & MVP

          Have you tried the Package command in ID which will do as you ask?

          • 2. Re: Document font
            David André Erichsen Level 1

            Yes, I have. But I want to have a shortcut to do just that, without any other clicking. A script will do this mutch faster, and i want to have a routine that saves the fonts in every document. Also in the future I then find the correct font easy - see?

            • 3. Re: Document font
              Larry G. Schneider Adobe Community Professional & MVP

              The purpose of this forum is to help people compose scripts for their own purpose, not to have someone else write a free script for them. Have you tried anything? Are you willing to pay for someone to write the script?

              • 4. Re: Document font
                David André Erichsen Level 1

                Im sorry for asking for a complete script. I will try to figure it out.

                • 5. Re: Document font
                  David André Erichsen Level 1

                  OK, I now got this and it works:


                  tell application "InDesign"

                    tell front document

                    set ThePath to get file path as string

                    tell application "Finder"

                    try

                    make new folder at alias (ThePath) with properties {name:"Document fonts"}

                    end try

                    end tell

                   

                    package to ThePath with copying fonts, ignore preflight errors, copying profiles, updating graphics, including hidden layers and copying linked graphics

                   

                    end tell

                  end tell



                  How can I set the properties for the Pakage to only copy fonts, and not include report and linked graphics?

                  • 6. Re: Document font
                    Larry G. Schneider Adobe Community Professional & MVP

                    When I tried it seemed that the options are mandatory but they can be set to false. I just can't figure out how to do it. The inner tell making the Document fonts folder is unnecessary. The package command does that (at least for me when I tried without it).

                    • 7. Re: Document font
                      Dirk Becker Level 4

                      Use the "without" AppleScript keyword to set a boolean parameter to false.

                      Something like:

                       

                      package to ThePath with copying fonts without ignore preflight errors, copying profiles, updating graphics, including hidden layers and copying linked graphics

                      • 8. Re: Document font
                        Larry G. Schneider Adobe Community Professional & MVP

                        I thought I tried that but I guess I didn't have the syntax quite right.

                        • 9. Re: Document font
                          David André Erichsen Level 1

                          This work in InDesign CC:

                          But is there a way to delete the a folder right away, insted of moving it to the trash?



                          tell application "Adobe InDesign CC"

                            tell front document

                            set myDocPath to get file path as string

                           

                            set myTempPath to myDocPath & "temp:"

                           

                            set myFontPath to myTempPath & "Document fonts:"

                            try

                            package to myFontPath copying fonts yes copying linked graphics no including hidden layers yes copying profiles no updating graphics no ignore preflight errors yes creating report no force save yes

                            end try

                            end tell

                          end tell

                           

                          tell application "Finder"

                            set TheDest to myDocPath & "Document fonts:"

                           

                            try

                            make new folder at alias (myDocPath) with properties {name:"Document fonts"}

                            end try

                            try

                            make new folder at alias (myDocPath) with properties {name:"temp"}

                            end try

                           

                            try

                            move entire contents of folder myFontPath to folder TheDest

                            end try

                            move folder myTempPath to trash

                            --end try

                           

                          end tell

                          • 10. Re: Document font
                            David André Erichsen Level 1

                            Some bugs fixet with this, but still wonder if i can delete the temp folder without moving tor trash:


                            tell application "Adobe InDesign CC 2014"

                              tell front document

                              set ThePath to get file path as string

                             

                              set ThePath2 to ThePath & "temp-folder:"

                             

                              set ThePath3 to ThePath2 & "Document fonts:"

                              try

                              package to ThePath2 copying fonts yes copying linked graphics no including hidden layers yes copying profiles no updating graphics no ignore preflight errors yes creating report no include pdf no force save yes

                              end try

                              end tell

                            end tell

                             

                            tell application "Finder"

                              set TheDest to ThePath & "Document fonts:"

                             

                              try

                              make new folder at alias (ThePath) with properties {name:"Document fonts"}

                              end try

                              try

                              move entire contents of folder ThePath3 to folder TheDest

                              end try

                              move folder ThePath2 to trash

                              --end try

                             

                            end tell