[AS] Beast of a script needs help converting from Quark 8 to InDesign CS5
First off, THANK YOU for even reading this post. Here's the dilema. I work in a publishing company that used an AppleScript from Quark 8 to automate our pagination from set text we pull from our sales reps worksheets. About 8 months ago we switched fully to InDesign CS5, but have had to hold onto Quark 8 to be able to keep running our pagination. I'd like to see if the geniuses (yes, I've been trolling these forums looking to solve this myself and seen some great problems fixed) on these forums can help me figure out the proper conversion I would need to be able to leave Quark 8 in the rearview.
Here's our current code... (I warned you it was a beast)
set Ad_Props to {¬
{Ad_Label:"SPREAD – ", Ad_Width:2.495, Ad_Height:1.62, Ad_Text_Angle:0}, ¬
{Ad_Label:"FULL – ", Ad_Width:1.225, Ad_Height:1.62, Ad_Text_Angle:0}, ¬
{Ad_Label:"SPREAD – ", Ad_Width:2.495, Ad_Height:1.62, Ad_Text_Angle:0}, ¬
{Ad_Label:"JUNIOR – ", Ad_Width:0.90625, Ad_Height:1.62, Ad_Text_Angle:0}, ¬
{Ad_Label:"1/2H – ", Ad_Width:1.225, Ad_Height:0.785, Ad_Text_Angle:0}, ¬
{Ad_Label:"1/2V – ", Ad_Width:0.5875, Ad_Height:1.62, Ad_Text_Angle:90}, ¬
{Ad_Label:"1/3V – ", Ad_Width:0.5875, Ad_Height:1.2025, Ad_Text_Angle:90}, ¬
{Ad_Label:"1/4 – ", Ad_Width:0.5875, Ad_Height:0.785, Ad_Text_Angle:0}, ¬
{Ad_Label:"1/4 Strip – ", Ad_Width:0.26875, Ad_Height:1.62, Ad_Text_Angle:90}, ¬
{Ad_Label:"1/8H – ", Ad_Width:0.5875, Ad_Height:0.3675, Ad_Text_Angle:0}, ¬
{Ad_Label:"1/8V – ", Ad_Width:0.26875, Ad_Height:0.785, Ad_Text_Angle:90}, ¬
{Ad_Label:"Junior (GOLF) – ", Ad_Width:0.8, Ad_Height:1.62, Ad_Text_Angle:0}, ¬
{Ad_Label:"1/3V (GOLF) – ", Ad_Width:0.375, Ad_Height:1.62, Ad_Text_Angle:90}, ¬
{Ad_Label:"1/3sq. (GOLF) – ", Ad_Width:0.8, Ad_Height:0.785, Ad_Text_Angle:0}, ¬
{Ad_Label:"1/6V (GOLF) – ", Ad_Width:0.375, Ad_Height:0.785, Ad_Text_Angle:90}, ¬
{Ad_Label:"Directory Listing Only – ", Ad_Width:0.3, Ad_Height:0.3, Ad_Text_Angle:0}, ¬
{Ad_Label:"INSERT (# in notes) – ", Ad_Width:0.3, Ad_Height:0.3, Ad_Text_Angle:0}, ¬
{Ad_Label:"Other (See Notes) – ", Ad_Width:0.3, Ad_Height:0.3, Ad_Text_Angle:0}, ¬
{Ad_Label:"------------ – ", Ad_Width:0.3, Ad_Height:0.3, Ad_Text_Angle:0}}
set Position_Width to number
set Position_Width to 11.375
set Position_Height to number
set Position_Height to 1.875
set Jump_Height to number
set Jump_Height to 0
set Variable_Count to number
set Variable_Count to 0
set Variable_Height to number
set Variable_Height to (1.875 + (1.62 * Variable_Count))
set Last_Ad to number
set Last_Ad to 0
tell application "QuarkXPress"
activate
try
display dialog "WARNING: This version of 'Dummy Square Maker' runs much slower than the last version, a confirmation will tell you when you are finished. Please be patient." & return & return & "Make sure to have the text box selected" buttons {"Cancel", "Accept"} default button 2 with icon caution
set ThisBox to object reference of current box
tell story 1 of ThisBox
set (every paragraph where it is return) to ""
set style sheet of every text to null
set style sheet of every text to "DUMMY TEXTS"
repeat with i from 1 to (count of paragraphs)
try
tell paragraph i
set ThePage to my get_CurrentPage()
try
if it contains " – " then
set style sheet to "AD SIZE"
set Ad_Size to contents
set {This_Width, This_Height, this_angle} to {"", "", ""}
repeat with This_Ad in Ad_Props
if Ad_Size contains (Ad_Label of This_Ad) then
set This_Width to Ad_Width of This_Ad
set This_Height to Ad_Height of This_Ad
set this_angle to Ad_Text_Angle of This_Ad
exit repeat
end if
end repeat
set Ad_Box to my Make_Box(ThePage, {1.875, 10.875, This_Height + 1.875, This_Width + 10.875}, this_angle)
duplicate contents to (end of Ad_Box)
else if it contains "—" then
set style sheet to "AD REP/PLACEMENT"
duplicate contents to (end of Ad_Box)
else if it starts with "©" then
set style sheet to "AD REP/PLACEMENT"
delete (character 1)
duplicate contents to end of Ad_Box
if Position_Width ≤ 19.75 then
set Jump_Height to Jump_Height + This_Height
(*_________________This is where Ad Boxes Stack_________________*)
if (Jump_Height ≤ 1.62) then
set origin of bounds of Ad_Box to {Position_Height, Position_Width}
set Position_Height to Position_Height + This_Height
(*_________________This is where Ad Boxes more right_________________*)
else
set Position_Height to Variable_Height
(*set Position_Width to Position_Width + This_Width + 0.05*)
set Position_Width to Position_Width + Last_Ad + 0.05
set origin of bounds of Ad_Box to {Position_Height, Position_Width}
set Jump_Height to This_Height
set Position_Height to Variable_Height + This_Height
end if
set Last_Ad to This_Width
(*_________________This is where New Row appears_________________*)
else
set Position_Width to 11.375
set Variable_Count to Variable_Count + 1
set Variable_Height to (1.875 + (1.62 * Variable_Count))
set Position_Height to Variable_Height
set origin of bounds of Ad_Box to {Position_Height, Position_Width}
set Position_Height to Position_Height + This_Height
set Jump_Height to This_Height
set Last_Ad to This_Width
end if
else
duplicate contents to (end of Ad_Box)
end if
end try
end tell
on error errmsg number errnum
display dialog "There has been an error " & "[" & i & "] (" & errmsg & " [" & errnum & "])" buttons {"Okay"} default button 1 with icon stop
end try
end repeat
delete contents
set style sheet of every text to null
end tell
beep 2
display dialog "Automation Finished" & return & return & "IMPORTANT NOTE: Color your Ad Squares according to Sales Rep, and select them all and 'BRING TO FRONT [F5]', this is VITAL." buttons {"Okay"} default button 1 with icon stop
on error errmsg number errnum
beep 3
if errnum ≠ -128 then
beep
display dialog errmsg & " [" & errnum & "]" buttons {"OK"} default button 1 with icon stop
end if
end try
end tell
on Make_Box(ThePage, TheBounds, this_angle)
local ThePage, TheBounds, this_angle
tell application "QuarkXPress"
tell page ThePage of document 1
set Ad_Box to make new text box at end with properties {bounds:TheBounds, vertical justification:centered, color:"Rep_Other", shade:100, opacity:10, text angle:this_angle, frame:{style:solid line, color:"Black", shade:60, width:0.1}}
end tell
end tell
(*end tell*)
return Ad_Box
end Make_Box
on get_CurrentPage()
tell application "QuarkXPress"
tell document 1
return page number of current page
end tell
end tell
end get_CurrentPage
Hi,
I think with this, you can already make good progress in your work.
Good luck!
global mydocument
tell application "Adobe InDesign CS5.5"
set mydocument to active document
tell mydocument
set myParaStyle to paragraph style "DUMMY TEXTS"
tell page 1
set TheBounds to {0, 0, 20, 50}
set Ad_Box to make text frame
tell Ad_Box
set geometric bounds to TheBounds
set vertical justification of text frame preferences to center align
set contents to "This is the contents"
end tell
set myStory to parent story of Ad_Box
set applied paragraph style of every paragraph of myStory to myParaStyle
end tell
end tell
end tell
Your two handlers then look like this:
on Make_Box(ThePage, TheBounds, this_angle)
local ThePage, TheBounds, this_angle
tell application "Adobe InDesign CS5.5"
tell page ThePage of mydocument
set Ad_Box to make text frame
tell Ad_Box
set geometric bounds to TheBounds
set vertical justification of text frame preferences to center align
end tell
end tell
end tell
return Ad_Box
end Make_Box
on get_CurrentPage(CurrentTextFrame)
tell application "Adobe InDesign CS5.5"
tell mydocument
return name of parent page of parent page of CurrentTextFrame
end tell
end tell
end get_CurrentPage
Shorter version:
on get_CurrentPage(CurrentTextFrame)
tell mydocument of application "Adobe InDesign CS5.5"
return name of parent page of parent page of CurrentTextFrame
end tell
end get_CurrentPage
Ce message a été modifié par: OlivierBerquin
Similar Messages
-
Need help converting from 4.0 to 2011
hello,
Need help converting files from 4.0 to 2011.
thank you
Solved!
Go to Solution.
Attachments:
noise source.vi 73 KB
8673D.vi 30 KB
8970 FREQ.vi 26 KBattached as 8.2, which you can open
missing some subVIs - not sure if you already have them
Attachments:
8673D.vi 13 KB
8970 FREQ.vi 11 KB
noise source.vi 24 KB -
Need help converting from Actionscript 2.0 to 3.0
I have an old flash file that I need to update. Ufortunately I only ahve access to Flash Pro CC and when I open the file it says the program no longer supports Actionscript 2.0. When I test the file, I get the following compiler errors:
Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 3
1120: Access of undefined property ratio.
Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 20
1180: Call to a possibly undefined method number.
Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 27
1120: Access of undefined property _root.
Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 9, Column 27
1120: Access of undefined property ratio.
And on the MoneySlide layer in Actions:
this.ratio = 0;
this.loadBar._width = 0;
this.dragger.ratio.text= "$0";
dragger.onPress=function(){
this.startDrag(true,0,0,line._width,0);
this.onEnterFrame=function(){
ratio=Math.round(number(_root.transitBenefitLimit/100)*(thi s._x/(line._width/100)));
loadBar._width = Math.round(this._x);
dragger.ratio.text= "$"+ratio;
dragger.onRelease=dragger.onReleaseOutside=stopDrag;
Any help changing the code to be compatible with Actionscript 3? thanks in advance...as3:
this.ratio = 0;
this.loadBar.width = 0;
this.dragger.ratio.text= "$0";
dragger.addEventListener(MouseEvent.MOUSE_DOWN,downF);
var dragged_mc:MovieClip;
function downF(e:MouseEvent):void{
dragged_mc=MovieClip(e.currentTarget);
dragged_mc.startDrag(true,0,0,line.width,0);
dragged_mc.addEventListener(Event.ENTER_FRAME,enterframeF);
stage.addEventListener(MouseEvent.MOUSE_UP,upF);
function enterframeF(e:Event):void{
ratio=Math.round(Number(MovieClip(root).transitBenefitLimit/100)*(dragged_mc.x/(line.widt h/100)));
loadBar.width = Math.round(dragged_mc.x);
dragger.ratio.text= "$"+ratio;
function upF(e:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_UP,upF);
dragged_mc.removeEventListener(Event.ENTER_FRAME,enterframeF);
dragged_mc.stopDrag(); -
Need help converting a PDF to excel
Need help converting a PDF to excel, the icon to convert dissappeared suggestions?
Open the file in Acrobat, use File --> Save As... --> Microsoft Word.
Mylenium -
Here i need to convert from EA to CS.
Hi Dear friends,
iam having one requirement. that is conversion.
here is need to convert from EA to CS, for that one iam using FM: conversion_factor_get
But this is not converting and when i run program it was showing the error is "conversion of dimensionless units is possible".
Here i need to convert from EA to CS.
this is Eg:
DATA : LV_SS TYPE F,
LV_DEC(100) TYPE N,
LV_NUM(100) TYPE N.
call function 'CONVERSION_FACTOR_GET'
EXPORTING
NO_TYPE_CHECK = ' '
UNIT_IN = 'EA'
UNIT_OUT = 'CS'
IMPORTING
ADD_CONST = LV_SS
DECIMALS = LV_DECI
DENOMINATOR = LV_DEC
DIMENSION =
NUMERATOR = LV_NUM
EXCEPTIONS
CONVERSION_NOT_FOUND = 1
OVERFLOW = 2
TYPE_INVALID = 3
UNITS_MISSING = 4
UNIT_IN_NOT_FOUND = 5
UNIT_OUT_NOT_FOUND = 6
OTHERS = 7
if SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
write : lv_ss, lv_dec, lv_num.Hi
first ensure that the both values CS and EA exist in the table T006
then only the conversion of the units is possible using the fun module
'CONVERSION_FACTOR_GET'
Since the unit CS is not available in T006 table it is not working
This fun module in turn uses the table data T006 for the conversion of units
Regards
Anji -
Need help getting from 10.5.8 to 10.6.
need help getting from 10.5.8 to 10.6. i know i'm late to the game!
If you are not sure of what you are doing,If you are worried about losing anything when doing a major systems upgrade/update,
Before embarking on a major OS upgrade, it would be wise, advisable and very prudent if you backup your current system to an external connected and Mac formatted Flash drive OR externally connected USB, Thunderbolt or FireWire 800, Mac formatted hard drive. Then, use either OS X Time Machine app to backup your entire system to the external drive OR purchase, install and use a data cloning app, like CarbonCopyCloner or SuperDuper, to make an exact and bootable copy (clone) of your entire Mac's internal hard drive. This step is really needed in case something goes wrong with the install of the new OS or you simply do not like the new OS, you have a very easy way/procedure to return your Mac to its former working state.
Older version of CarbonCopyCloner found here.
http://mac.filehorse.com/download-carbon-copy-cloner/2734/
Older versions of SuperDuper can be found on the SuperDuper Website and Homepage.
http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html
Then, determine if your Mac meets ALL minimum system install requirements.
Mac OS X v10.6 Snow Leopard system requirements
Purchased Installer disc here.
http://store.apple.com/us/product/MC573Z/A/mac-os-x-106-snow-leopard
To install Snow Leopard for the first time, you must have a Mac with:
An Intel processor
An internal or external DVD drive, or DVD or CD Sharing
At least 1 GB of RAM (additional RAM is recommended)
A built-in display or a display connected to an Apple-supplied video card supported by your computer
At least 5 GB of disk space available, or 7 GB of disk space if you install the developer tools.
In addition, see this discussion for more relevant info that you may need if you have any other questions or issues.
Snow Leopard upgrade - keeps Photoshop? -
Converted from pagemaker to indesign
We recently converted from pagemaker to indesign CS6, how can i do this (image above) in indesign? When i open my file in indesign the part no, desc, qty, list line where just underlined (image below) i would like the header to be within the lines like the image above.
Thank you for your help, it took us awhile to convert to indesign and am still learning.You'll need to work with paragraph rules—rule above and rule below. Find them in the paragraph panel flyout menu or the control panel flyout menu when you have the text tool active.
Michael Riordan
http://www.learnadobesoftware.com -
Need to import a Medical Dictionary from Quark to InDesign
Just switched from Quark to InDesign for a Medical Journal and they need their dictionary to be loaded into InDesign.
I have their .QUD file from Quark but am having difficulty loading it through the preferences.
Any help would be great.
Thanks in advance!From your description I'm guessing a .qud is a Quark User Dictionary file from Windows XPress. If so, then it should be a simple text file.<br /><br />The best thing to do is open it in a text editor, make sure it all looks clean, and then paste all of the text into InDesign and run a spell check, keeping all of the words as you go. A bunch of clicks for the conversion, but it will create a user dictionary file as InDesign requires, which is a different format from Quark's.<br /><br />When done back up your new file from ~/Library/Application Support/Adobe/Linguistics/Dictionaries/Adobe Custom Dictionary/<language of the file>. (Mac location, Windows should be similar.)
-
How do I upgrade the plugins needed for my earlier version of InDesign CS5 so I can open a file in a later version of CS5?
You can’t. You have upgrade or have whoever is send you files save as IDML. Don’t expect perfection.
-
Is it possible to convert from Quark 9 to ID 5.5
I would like to be able to convert from Quark 9 to ID 5.5 an vice versa, but the Markzware program Q2id is not competable with ID 5.5. Is there another sollution?
I have seen sollutions like saving it as a Quark 4 project, but that is not possible in Quark 9. Lowest possebility is saving it as quark project 8. But that wil not open in ID 5.5.
So if there is anybody who knows an sollution, please share it. : )You may post your question in the forum for InDesign.
-
Is there one-on-onePrepress help in Denver Colorado for InDesign CS5?
Is there one-on-one Prepress help in Denver Colorado for InDesign CS5?
What sort of help are you looking for?
Thanks,
Stephen
http://sterlingcomputing.com -
I am a beginner at Final Cut Pro. Need help converting MPEG-2 to use.
I am a beginner at Final Cut Pro. I have mpeg-2 video footage that I am trying to import the footage into Final cut, but can't. I understand I need to convert the file format. I am unfamiliar with how to go about the converding file formats and the codec what is the best way to go about converting the file format so I can edit it on Final cut pro?
Where did the files originate? (How were they created?)
Some formats can be brought in with the help of plug-ins.
MPEG Streamclip can usually convert them to Quick Time.
Russ -
I need help converting a PDF to a word file. I purchased Acrobat for this purpose?
I need help using this download. I purchased Acrobat because I need to convert a PDF file to a word file. Can you give me instruction on how to do this.
Thank you,Open the file in Acrobat, use File --> Save As... --> Microsoft Word.
Mylenium -
Indesign CS5.5 Relink Script needs help
Hi, I'm trying to relink images in an InDesign CS5.5 file to a different server using a script. This is what I have so far, but when I run the script I get errors and can't relink because "Either the file does not exist, you do not have permission, or the file may be in use by another application". Does anyone know how to make this script work? I'm fairly new to scripting.
Here is the script I have:
tell application "Adobe InDesign CS5.5"
tell document 1
set linkList to links
set errInfo to "" -- We'll display error if we can't relink an item
repeat with x in linkList
if (x's status) is not normal then -- I usually check for any link that has an error
-- This should only return an AppleScript path with ":" separators
set linkPath to (x's file path) as string
if "Volumes/Calendars_2013 FPO" is in linkPath then
set AppleScript's text item delimiters to "Volumes/Calendars_2013 FPO"
set linkPath to (linkPath's text items) -- Create a list of text items
set AppleScript's text item delimiters to "Volumes/Calendars_2013"
set linkPath to (linkPath as string) -- Concatenate with new path
set AppleScript's text item delimiters to "" -- Reset TIDs
try
-- Need to make our string (path) into an alias path
relink x to alias linkPath
try
update x -- This can be helpful
end try
on error err
-- We'll store link name if error occurs
set errInfo to (errInfo & return & x's name)
end try
end if
end if
end repeat
-- If an error occurs while trying to relink, we'll display it
if (count errInfo) > 0 then display dialog ("Can't relink:" & errInfo)
end tell
end tell
--HectorI just tried adding collens to the end of the folder path. For some reason the script skipped the relink line. Below is the code with your update. I'm thinking its not finding the images because the script needs to make a list of all the images and choose the one that matches the missing image.
tell application "Adobe InDesign CS5.5"
tell document 1
set linkList to links
set errInfo to "" -- We'll display error if we can't relink an item
repeat with x in linkList
if (x's status) is not normal then -- I usually check for any link that has an error
-- This should only return an AppleScript path with ":" separators
set linkPath to (x's file path) as string
if "Calendars_2013 FPO:" is in linkPath then
set AppleScript's text item delimiters to "Calendars_2013 FPO:"
set linkPath to (linkPath's text items) -- Create a list of text items
set AppleScript's text item delimiters to "Calendars_2013:"
set linkPath to (linkPath as string) -- Concatenate with new path
set AppleScript's text item delimiters to "" -- Reset TIDs
try
-- Need to make our string (path) into an alias path
relink x to alias linkPath
try
update x -- This can be helpful
end try
on error err
-- We'll store link name if error occurs
set errInfo to (errInfo & return & x's name)
end try
end if
end if
end repeat
-- If an error occurs while trying to relink, we'll display it
if (count errInfo) > 0 then display dialog ("Can't relink:" & errInfo)
end tell
end tell
--Thanks for you help -
Need help converting quicktime movies into Flash files
I need to convert a QT, PhotoJPEG compressed, movie file into a .flv format. I have AE 6.5 Standard and it keeps quitting on exporting a SWV file which would could probably get me by with my client. But, again, it errors out saying something like a JPG is busy, or a file is busy.
I have FlipforMac,a purchased version. But I'm not sure if converting it into a .wmv and then a Flash file is the best route or is even possible.
Any suggestions or ideas of software that I could purchase??
~reickoi don't think you have read up on the use of flash video
(FLV). there's nothing you need that you do
not already have (except maybe quicktime pro or some other
video editing program). the FLV exporter
comes FREE with flash 8. You should be able to open your
quicktime movie in QT PRO and export to FLV
format - then use any of the flash playback components for
FLV files - best bet is to read the help
docs on this subject and go to the devnet section of
adobe.com where there are several in-depth
articles about implementing flash video into your site.
--> **Adobe Certified Expert**
--> www.mudbubble.com
--> www.keyframer.com
rhian wrote:
> Hi,
> Thanks for your reply. I am using Flash 8. I've been
looking into streaming
> and it's very expensive with quicktime movies, however
I've found a company
> that will stream flash movies much more cheaply which is
why I want to convert
> it to a flash movie.
>
> Sorry are you say that Quicktime Pro allows you convert
files into flash
> formats?
> Rhian
>
Maybe you are looking for
-
Evaluate Expression from PL/SQL without passing it SQL engine
I have an expression similar to '1+2+(3*6)/12*ROUND(10*3, 3)' which I generate programatically in VARCHAR2 variable. One way to calculate the expression is execute immediate 'select '||exp||' from dual' into lv_x; which would return the value. But my
-
i was microsft sql 2000 user. where is use join like this select max(Date) from Table1 , table2 where table1.field = abc and table2.field = table1.field. but in abap it says santax error like comma with select???
-
Bubba was bragging to his boss one day, "You know, I know everyone there is to know. Just name someone, anyone, and I know them." Tired of his boasting, his boss called his bluff, "OK, Bubba how about Tom Cruise?" "Sure, yes, Tom and I are old friend
-
I have 1000 images in a folder, i want to check their details like resolution, dimensions, color mode, file format, file size and file name into excel with nice user interface. Pls help me, m just learning ABCD in VB.
-
How to execute a url throu java iwthout using any browser?
hi all i want execute one url in my application is it possible to execute a url with out using any browser and jeditor pane pls help i need this help ... micehaljalls [email protected]