in

Quark Forums

Is it possible to relink images in quark 6.5 document using applescript???

Last post 04-21-2011 7:19 AM by xack. 22 replies.
Page 1 of 2 (23 items) 1 2 Next >
Sort Posts: Previous Next
  • 09-18-2008 4:12 AM

    Is it possible to relink images in quark 6.5 document using applescript???

    HI,

    I have quark 6.5 document. i want to relink the missing images found in that document. I dont get any idea abt relinking...

     First,is it possible????if so please come up with your ideas immediately..

     

     

    Thanks in advance.

    poovili. 

     

  • 09-18-2008 6:36 AM In reply to

    Re: Is it possible to relink images in quark 6.5 document using applescript???

    No you cannot re-link them per say.However, you can note (copy) all of its properties (scale, rotaion, x offset, ect.) import the "new" image and re-apply the properties.

     Hope this helps!

    Michel Lemieux
    Click here --> to visit my PUBLISHING & SCRIPTING FORUM

  • 09-19-2008 3:50 AM In reply to

    Re: Is it possible to relink images in quark 6.5 document using applescript???

     Hi thank u very much....its helps me great....

  • 09-19-2008 5:01 AM In reply to

    Re: Is it possible to relink images in quark 6.5 document using applescript???

     Hi,

    Need another help.....how to import the image to quark document???

    Thanks in advance...

    Poovili..

     

  • 09-19-2008 5:12 AM In reply to

    • Emma
    • Top 10 Contributor
    • Joined on 07-07-2004
    • Leeds, UK
    • Posts 1,184

    Re: Is it possible to relink images in quark 6.5 document using applescript???

    set image 1 of picture box 1 of document 1 to .... (path to your image).

    It rather depends how the script is going to know what picture to use. It may be a path calculated from the existing image (e.g. oldname & ".HR" if you were replacing low res with high res and they'd been named properly!)

    An easy way to get the syntax right is to use 'choose file', e.g.

    set my_pic to choose file
    set image 1 of picture box 1 to my_pic

    And don't ask me what image 2 of picture box 1 might be!??
  • 09-21-2008 9:48 PM In reply to

    Re: Is it possible to relink images in quark 6.5 document using applescript???

    Hi,

    My quark document contains group boxes (text box and picture box) which grouped together. I need to place the picture i choose in that grouped picture box... is this possible??? if it so...please give me ur ideas.....

  • 09-22-2008 9:59 AM In reply to

    Re: Is it possible to relink images in quark 6.5 document using applescript???

     Applescript does not care about that, it will act upon your picture box where ever it may lie.

    Try this:

    001   tell application "QuarkXPress Passport 6.x"
    002      activate
    003      set DocName to name of document 1
    004      tell document DocName
    005         repeat with i from 1 to count of images
    006            tell image i
    007               set ImageBox to object reference of picture box 1
    008               -- Copy writable properties
    009               if not missing then
    010                  set Img_angle to angle
    011                  set Img_color to color
    012                  set Img_greek_pictures to greek pictures
    013                  set Img_image_trap to image trap
    014                  set Img_invert_runaround to invert runaround
    015                  set Img_model to model
    016                  set Img_name to name
    017                  set Img_negative to negative
    018                  set Img_offset to offset
    019                  set Img_scale to scale
    020                  set Img_screen to screen
    021                  set Img_screen_angle to screen angle
    022                  set Img_screen_frequency to screen frequency
    023                  set Img_screen_function to screen function
    024                  set Img_shade to shade
    025                  set Img_show_half_tone to show half tone
    026                  set Img_skew to skew
    027                  set Img_suppress_printing to suppress printing
    028                  
    029                  -- Get new image path
    030                  set Img_file_path to (file path) as text
    031                  set Img_file_path to my FindReplace("Text of the file path to replace", "text to replace with", Img_file_path)
    032                  
    033                  -- Re-import picture
    034                  set image 1 of ImageBox to file Img_file_path
    035                  
    036                  -- Re-set image properties
    037                  tell image 1 of ImageBox
    038                     set angle to Img_angle
    039                     set color to name of Img_color
    040                     set greek pictures to Img_greek_pictures
    041                     set image trap to Img_image_trap
    042                     set invert runaround to Img_invert_runaround
    043                     set model to Img_model
    044                     set name to Img_name
    045                     set negative to Img_negative
    046                     set offset to Img_offset
    047                     set scale to Img_scale
    048                     set screen to Img_screen
    049                     set screen angle to Img_screen_angle
    050                     try
    051                        set screen frequency to Img_screen_frequency
    052                     end try
    053                     set screen function to Img_screen_function
    054                     set shade to Img_shade
    055                     set show half tone to Img_show_half_tone
    056                     set skew to Img_skew
    057                     set suppress printing to Img_suppress_printing
    058                  end tell
    059               end if
    060            end tell
    061         end repeat
    062      end tell
    063   end tell

    064   on FindReplace(FindWhat, ReplaceBy, ThisString)
    065      copy the text item delimiters to OldDelims
    066      set the text item delimiters to {FindWhat}
    067      set TempList to every text item of ThisString
    068      set the text item delimiters to {ReplaceBy}
    069      set NewString to TempList as text
    070      set the text item delimiters to OldDelims
    071      return NewString
    072   end FindReplace

    Notes: • The line numbers included with this script are there to aid future discussions. In order to use this script, you will have to strip all of them.

    You will need to modify line #31 to comply with your scenario.

    Hope this helps!

    Michel Lemieux
    Click here --> to visit my PUBLISHING & SCRIPTING FORUM

  • 09-22-2008 10:59 PM In reply to

    Re: Is it possible to relink images in quark 6.5 document using applescript???

     Hi,

     

    Thanks a lot.....Im surprised it is not working for me when it is grouped. My quark doc contains group box where text box and picture box is grouped together. I too used the same syntax but the picture is placing for me.........

     

    Please do help me..Thanks in advance... 

  • 10-23-2008 6:28 AM In reply to

    • rajeev
    • Top 75 Contributor
    • Joined on 09-29-2004
    • Bangalore
    • Posts 154

    Re: Is it possible to relink images in quark 6.5 document using applescript???

    Hi,

    First you have to write a script to ungroup the boxes and then you can do it. As per as my concern for re-linking I will say yes you can do it.

    With Best Regards,
    Rajeev Kumar
    Filed under:
  • 11-01-2009 11:58 PM In reply to

    • prabu
    • Top 150 Contributor
    • Joined on 06-04-2009
    • Chennai
    • Posts 64

    Re: Is it possible to relink images in quark 6.5 document using applescript???

    Hi Scripting_Ace

     When i try to execute above script, I got the AppleScript Runtime Error message

    "QuarkXPress got an error: File some object wasn't found." in the following line

      set image 1 of ImageBox to file Img_file_path

    I don't think why this error occurs. Please suggest me.

     ( Note :It's working fine in Quarkxpress 7.5. Only in Quarkxpress 6.5, the above error occurs )

     

    Regards
    Prabu
  • 12-10-2009 4:25 AM In reply to

    • prabu
    • Top 150 Contributor
    • Joined on 06-04-2009
    • Chennai
    • Posts 64

    Re: Is it possible to relink images in quark 6.5 document using applescript???

     Hi Scripting_Ace

     In #34, I am getting error. Pls suggest me to solve that error.

    Regards
    Prabu
  • 03-04-2010 8:47 AM In reply to

    • TynanD
    • Not Ranked
    • Joined on 03-04-2010
    • Posts 7

    Re: Is it possible to relink images in quark 6.5 document using applescript???

     Hello all, noob on applescript here

     The script works, thanks for that

     However it's a bit on the raw side, it rechanges the path names when I run it again and more importantly doesn;t seem to be able to grab the picture path when the link is showing as missing which is rather annoying, is it not possible to grab the picture path from the picture usage, I'm not sure why it fails when the picture sttus is missing

     Thanks

    Tynan

  • 03-04-2010 9:12 AM In reply to

    • JRS
    • Top 25 Contributor
    • Joined on 05-29-2004
    • Colorado
    • Posts 653

    Re: Is it possible to relink images in quark 6.5 document using applescript???

    I'm not sure I'm remembering this correctly, but I think when scripting some image stuff long ago, I found that you had to show the Usage dialog in the UI to "load" the paths for missing images to be able to access them from AppleScript. So you might try showing Usage and viewing the picture data, then closing the dialog and running the script, and see if it behaves any differently. That's all I've got, I'm afraid...
  • 03-04-2010 9:15 AM In reply to

    Re: Is it possible to relink images in quark 6.5 document using applescript???

    TynanD:

    ...However it's a bit on the raw side. ...

     

    Well it was made available to you free of charge !!!

     

    TynanD:

    ... more importantly doesn;t seem to be able to grab the picture path when the link is showing as missing which is rather annoying, is it not possible to grab the picture path from the picture usage, I'm not sure why it fails when the picture sttus is missing

    Commenting out lines 009 and 059 should allow the script to work on missing images as well.

     

    HTH

     

     

    Michel Lemieux
    Click here --> to visit my PUBLISHING & SCRIPTING FORUM

  • 03-04-2010 9:22 AM In reply to

    • TynanD
    • Not Ranked
    • Joined on 03-04-2010
    • Posts 7

    Re: Is it possible to relink images in quark 6.5 document using applescript???

    yuk yuk, not what I meant, I was just pointing out a few quirks

     

    I did try removing the if but it then throws up an error when it can;t get the path for missing pictures, perhaps that's why the if was there to start with?

     I have found another script which lists missing picture paths perfectly so clearly it's doable, perhaps even for a noob like me, I do php myself, this applescript is all a bit crazee to me

    Thanks for the prompt answers, much appreciate, my goal is for it to relink as told where possible for all pictures and leave links alone where it can't, I have a javascript that does that for InDesign and it's brill

    Thanks

    Tynan

     

    tell application "QuarkXPress"
        tell document 1
            set Missing_Images to {} -- Create an empty list
            try -- Wrap in TRY BLOCK so script does NOT fail if nothing is returned
                set Missing_Images to file path of (every image whose missing is true)
            end try -- As is says
            if Missing_Images is {} then -- The list is still empty so do your stuff here
                display dialog "OK" giving up after 3
            else -- List has items (file paths for missing images)
                close saving no
            end if
        end tell
    end tell 

Page 1 of 2 (23 items) 1 2 Next >
Powered by Community Server (Commercial Edition), by Telligent Systems