Bospoking Scripts?

Discuss AppleScripting for QuarkXPress 10, 9 & 8 (and before)
Rakesh Solanki
Posts: 0
Joined: 18 Dec 2012, 15:35

Bospoking Scripts?

Post by Rakesh Solanki » 18 Dec 2012, 09:52

I've only just started to look into what Quark can do with Applescripts and it is amazing but with my particular workload I would like to alter some of these to suit my own needs and I cant find any threads which state a solution to my issues...I have one of two queries:1) Is it possible to alter the 'Foldr to Select PBoxes' script so that PDF's can be accepted aswell.2) Is it possible to change the 'Place Name' script so that the text is a different font, size and the text is justified to the top rather than centered?I hope someone can shed some light on this as it would be such an immense help!Rak

Jean-Marie Schwartz
Posts: 1174
Joined: 23 Nov 2004, 04:30

Bospoking Scripts?

Post by Jean-Marie Schwartz » 18 Dec 2012, 23:26

1) You can try adding a line in the part:
set theImageList to every file of theFolder whose kind is not "alias" and
file type is "TIFF" or name extension [b]is "TIF" [b]or
file type [b]is "EPSF" [b]or name extension [b]is "EPS" [b]or
file type [b]is "PICT" [b]or
file type [b]is "JPEG" [b]or name extension [b]is "JPG" [b]or name extension [b]is "JPEG" [b]or
file type [b]is "GIFf" [b]or name extension [b]is "GIF" [b]or
file type [b]is "BMP " [b]or name extension [b]is "BMP" [b]or
file type [b]is "RIFF" [b]or name extension [b]is "RIF" [b]or
file type [b]is "BINA" [b]or
file type [b]is "PNTG" [b]or name extension [b]is "PNG" [b]or
file type [b]is "BMPf"
like this:
file type[b]is"PDF"[b]orname extension[b]is"PDF"[b]or
Not tried it but worth a shot. If this does not work, then I don't think it'd be possible. (I think the way Quark handles PDF import might be different from importing other image types).2) Browse to the section that will create the text box and change line:[b]set nameBox [b]to [b]make new text box at [b]before generic box id theID with properties {bounds:{BoxC + boxOffset, BoxB, BoxC + boxHeight + boxOffset, BoxD}, runaround:none runaround, vertial justification:centered, color:null}to:set nameBox to make new text box at before generic box id theID with properties {bounds:{BoxC + boxOffset, BoxB, BoxC + boxHeight + boxOffset, BoxD}, runaround:none runaround, vertical justification:top justified, color:null}then add after line:set justification of paragraph 1 of story 1 of nameBox to centeredthis one:setfontof story 1 of nameBox to "Myriad Pro" -- or whatever font you want that is activated and accessible by Quarkset size ofstory 1 of nameBox to "9pt" -- or whatever size you wishHTH.

Rakesh Solanki
Posts: 0
Joined: 18 Dec 2012, 15:35

Bospoking Scripts?

Post by Rakesh Solanki » 19 Dec 2012, 02:47

Hi, thanks for the response.Your guide for number 2 works perfectly!And its great that those 2 line additions can be changed to suit whatever the project may be.For the first query I did try your suggestion before I posted here and it doesn't work.But maybe this is just beginners luck but I found a solution.Changing these lines:set theImageList to every file of theFolder whose kind is not "alias" and file type is "TIFF" or name extension is "TIF" or file type is "EPSF" or name extension is "EPS" or file type is "PICT" or file type is "JPEG" or name extension is "JPG" or name extension is "JPEG" or file type is "GIFf" or name extension is "GIF" or file type is "BMP " or name extension is "BMP" or file type is "RIFF" or name extension is "RIF" or file type is "BINA" or file type is "PNTG" or name extension is "PNG" or file type is "BMPf"to:set theImageList to every file of theFolder whose kind is "PDF" and file type is "PDF" or name extension is "PDF"works a treat!!! Success - PDF's are now importing just like images as before.Not bad for someone who's only looked at scripting this week huh.Thanks for your help - very very much appreciated!Rak :)

Rakesh Solanki
Posts: 0
Joined: 18 Dec 2012, 15:35

Bospoking Scripts?

Post by Rakesh Solanki » 19 Dec 2012, 02:49

How do you stop the text from bunching up as my posts show and make it read like your posts??

Jean-Marie Schwartz
Posts: 1174
Joined: 23 Nov 2004, 04:30

Bospoking Scripts?

Post by Jean-Marie Schwartz » 19 Dec 2012, 03:59

Rakesh Solanki wrote:How do you stop the text from bunching up as my posts show and make it read like your posts??
You can either insert code in the text when it's basic or activate the Development menu in Safari so that you can choose another User Agent such Firefox 4 for Mac (what I did this morning). I think he's Matthias who told about it sometime. Well whoever it is I read about the workaround here on the forums. So for AppleScript code, I just copy/paste it from Script Debugger to the window here and I'm done. (This said one has to switch User Agent prior to clicking Reply!)
Oh! nice catch for the PDFs! Always good to know!

Rakesh Solanki
Posts: 0
Joined: 18 Dec 2012, 15:35

Bospoking Scripts?

Post by Rakesh Solanki » 19 Dec 2012, 07:23

Oh - an additional item to the 2nd issue - is there any way of repeating the script so that it will more for more than one selected picture box??I have 12 per page and it would beneficial if I could select them all and run the 'place name' script.Rak

Jean-Marie Schwartz
Posts: 1174
Joined: 23 Nov 2004, 04:30

Bospoking Scripts?

Post by Jean-Marie Schwartz » 19 Dec 2012, 21:23

Then start with sth like this:
tell application "QuarkXPress95"
tell document 1
set TheBoxes to object reference of every picture box whose selected is true
repeat with TheBox [b]in TheBoxes
[b]tell TheBox
[b]if box type [b]is [b]not picture box type [b]or file path [b]of image 1 [b]is null [b]then [b]error "Please select a single picture box containing an image."
[b]set theID [b]to uniqueID
[b]end [b]tell
Yet haven't tried it fully but it should be a good starter.

Rakesh Solanki
Posts: 0
Joined: 18 Dec 2012, 15:35

Bospoking Scripts?

Post by Rakesh Solanki » 21 Dec 2012, 08:36

i've tested that out and I get a lot of syntax errors - even amending and editing bits here n there so I'm not sure this works.Rak

Jean-Marie Schwartz
Posts: 1174
Joined: 23 Nov 2004, 04:30

Bospoking Scripts?

Post by Jean-Marie Schwartz » 22 Dec 2012, 02:28

So can you post the code so that I can have a look at it?

Jean-Marie Schwartz
Posts: 1174
Joined: 23 Nov 2004, 04:30

Bospoking Scripts?

Post by Jean-Marie Schwartz » 22 Dec 2012, 06:47

Rakesh Solanki wrote:I get a lot of syntax errors
Thats odd. The piece of script Ive posted shows clearly mine has compiled OK so no syntax error at all. Or do mean errors at runn time?

Post Reply

Return to “QuarkXPress 8, 9 & 10: AppleScript”