Quantcast
Channel: Quark Forums
Viewing all articles
Browse latest Browse all 2166

Deleting unused styles

$
0
0

Hi all! Here is a script that'll delete every unused para and char style sheet and delete every non-default color. HTH.

(Note that the Satimage.osax is required for sorting the lists in the handlers.) 

propertyDefaultColors : {0, 1, 5, 6, 7, 8} -- these are the uniqueID of the default colors of Quark (I might have deleted RGB a while ago though so if you do have RGB colors as default you should add 2, 3, 4 in this list)


tellapplication"QuarkXPress95"

telldocument 1

-- COLORS -> comment the relative lines if you don't want to delete colors

-- NOTE: if you fear some non-default color are used in some used objects or style sheets, you can modify the script in order to get name of color of every generic box, etc.

setTheColorstoeverycolor spec

-- FIRST we stock the styles both existing and used

setListeStylesParagraphestonameofeverystyle spec

setListeStylesCaracterestonameofeverycharacter spec

setStylesParagraphesUtilisestomyGetUsedParaStyles()

setStylesCaracteresUtilisestomyGetUsedCharStyles()

-- THEN we delete any unused style

-- deleting style spec (paragraph style sheets)

repeatwithifrom 1 to (lengthofListeStylesParagraphes)

ifitemiofListeStylesParagraphesis notinStylesParagraphesUtilisesthen

try

deletestyle spec (itemiofListeStylesParagraphes)

endtry

endif

endrepeat

-- deleting character spec (character style sheets)

repeatwithifrom 1 to (lengthofListeStylesCaracteres)

ifitemiofListeStylesCaracteresis notinStylesCaracteresUtilisesthen

try

deletecharacter spec (itemiofListeStylesCaracteres)

endtry

endif

endrepeat

-- and deleting colors -> comment the following lines if you don't want to delete colors

repeatwithAColorinTheColors

ifuniqueIDofAColoris notinDefaultColorsthen

deleteAColor

endif

endrepeat

myBip(2)

endtell

endtell


onGetUsedParaStyles()

tellapplication"QuarkXPress95"

tell document 1

setTheStylestonameofstyle sheetofeveryparagraphofeverystory

setTheStylestomySortMyList(TheStyles)

returnTheStyles

endtell

endtell

endGetUsedParaStyles


onGetUsedCharStyles()

tellapplication"QuarkXPress95"

tell document 1

setTheCharStylestonameofcharacter styleofeverytext style rangeofeverystory

setTheCharStylestomySortMyList(TheCharStyles)

returnTheCharStyles

endtell

endtell

endGetUsedCharStyles


onSortMyList(TheList)

setTheSortedListtosortlistTheListwithremove duplicates

returnTheSortedList

endSortMyList


onBip(x)

beepx

endBip


Viewing all articles
Browse latest Browse all 2166

Trending Articles