Nieuw Quark document met AppleScript

ik heb de volgende code voor het aanmaken van een nieuw document in Quark met AppleScript:

[code:1:0c1f74558f]set boxPropsPic1 to {bounds:{20, 10, 50, 60}}
set boxPropsText1 to {bounds:{20, 70, 50, 120}}
set boxPropsPic2 to {bounds:{60, 10, 90, 60}}
set boxPropsText2 to {bounds:60, 70, 90, 120}}

tell application "QuarkXPress Passport"
make new document
tell front document
make picture box at beginning with properties boxPropsPic1
make text box at beginning with properties boxPropsText1
make picture box at beginning with properties boxPropsPic2
make text box at beginning with properties boxPropsText2
end tell
end tell[/code:1:0c1f74558f]

nu wilde ik het volgende weten:

voor het maken van een text of picture box moet je de x en y waarden opgeven en de waarden voor de hoogte en breedte van de box.
Maar als je bij de x en y 10 mm opgeeft, dan begint hij de breedte en de hoogte te tellen vanaf de nul.
Als ik dan bijvoorbeeld 30 mm opgeef voor de breedte, dan is hij maar 20 in het nieuwe document.
Is er een manier om de waardes van de breedte en de hoogte vanaf de x en y waardes te laten beginnen inplaats vanaf de nul?

en kan je bij het maken van een nieuw document ook de grootte van het document in de code instellen?
iets zoals:

[code:1:0c1f74558f]set newDoc to {bounds:{20, 10, 50, 60}}

tell application "QuarkXPress Passport"
make new document with properties newDoc
end tell[/code:1:0c1f74558f]
ofzo?

deze werkt dan niet… maar hoe moet ik de waardes van het nieuwe document anders aangeven?

Aanmaken nieuw document: [code:1:b54f30f489] set newHeight to 297 set newWidth to 210

tell application "QuarkXPress Passport™"
activate

	tell default document 1
		set oldHeight to page height
		set oldWidth to page width
		set oldAutoTextBox to automatic text box
		set oldGuidesShowing to guides showing
		set xDocMeasure to horizontal measure
		set yDocMeasure to vertical measure
		set page height to (newHeight as string) & "mm"
		set page width to (newWidth as string) & "mm"
		set automatic text box to false
		set guides showing to true
		set horizontal measure to millimeters
		set vertical measure to millimeters
		
	end tell
	make document at beginning

[/code:1:b54f30f489]
hiermee heb je ‘default’ waarden voor een nieuw document aangemaakt; en de oude 'default waarden nog vast liggen in variabelen. Je nieuwe document heeft nu hxb = 297x210

Je kunt nu bijv. direct even de paginainstellingen doen; ik leg hier de bleed vast, en pak een ppd voor een linotronic:

[code:1:b54f30f489]
tell document 1
set view scale to fit page in window
tell print setup
–try setting the best possible printer
set Printerlist to printer type list
set printer_count to the count of the Printerlist
set PrintReady to false
repeat with i from 1 to the printer_count
set this_printer to item i of the Printerlist
if this_printer is equal to "Linotronic 630 V 3.3 J" then
set PrintReady to true
set printer type to this_printer
end if
end repeat

			set registration marks to centered
			set registration marks offset to 0
			--set paper height to (newHeight + 12 as string) & "mm"
			set paper width to (newWidth + 13 as string) & "mm"
			set orientation to portrait
			set data format to binary data
			set resolution to 600
			set page position to center horizontal
			set separation to false
			set print colors to composite CMYK
			
		end tell
	end tell

[/code:1:b54f30f489]

een paginavullende picture box - zonder kleur:

[code:1:b54f30f489]
tell page 1 of document 1
make picture box at beginning with properties {bounds:{"0 mm", "0 mm", (newHeight as string) & "mm", (newWidth as string) & "mm"}, locked:true}
tell picture box 1
set NoColor to "none"
try
set color to NoColor
on error
set NoColor to "geen"
set color to NoColor
end try
end tell
end tell
[/code:1:b54f30f489]
Hierbij zie je dat in de bounds de eenheden wederom in mm aangegeven zijn; dit zou eigenljik niet hoeven, omdat ik bij het aanmaken van het document:

[code:1:b54f30f489]
set horizontal measure to millimeters
set vertical measure to millimeters
[/code:1:b54f30f489]
heb gegeven.

aan het eind van je script geef je weer aan:

[code:1:b54f30f489]
tell default document 1
set page height to oldHeight
set page width to oldWidth
etc…
[/code:1:b54f30f489]
… en je ‘default’ document instellingen zijn weer netjes hersteld

het werkt perfect

vriendelijk bedankt!

jij weet zeker ook niet toevallig hoe je een text box vanaf een x waarde laat maken in een document?

nogmaals bedankt

jawel; dat weet ik toevallig wel :wink: in principe hetzelfde als je picture-box: [code:1:4736e2301f] tell page 1 of document 1 make text box at beginning with properties {bounds:{"0 mm", "0 mm", (newHeight as string) & "mm", (newWidth as string) & "mm"}, locked:true} end tell [/code:1:4736e2301f]

ok, thnx! :)

maar hoe werkt het dan als je meerdere text boxen onder elkaar of naast elkaar wilt plaatsen?
als ik er zo 2 wil maken, dan wordt de 2e binnen de 1e text box geplaatst en niet eronder

[code:1:af0c7bb995] set newWidth to 210 set newHeight to 297

tell application "QuarkXPress Passport™"
activate

tell default document 1
	set oldHeight to page height
	set oldWidth to page width
	set oldAutoTextBox to automatic text box
	set oldGuidesShowing to guides showing
	set xDocMeasure to horizontal measure
	set yDocMeasure to vertical measure
	set page height to (newHeight as string) & " mm"
	set page width to (newWidth as string) & " mm"
	set automatic text box to false
	set guides showing to true
	set horizontal measure to millimeters
	set vertical measure to millimeters
	
end tell
make document at beginning

tell document 1
	set view scale to fit page in window
	tell print setup
		--try setting the best possible printer
		set Printerlist to printer type list
		set printer_count to the count of the Printerlist
		set PrintReady to false
		repeat with i from 1 to the printer_count
			set this_printer to item i of the Printerlist
			if this_printer is equal to "Linotronic 630 V 3.3 J" then
				set PrintReady to true
				set printer type to this_printer
			end if
		end repeat
		
		set registration marks to centered
		set registration marks offset to 0
		--set paper height to (newHeight + 12 as string) & "mm"
		set paper width to (newWidth + 13 as string) & "mm"
		set orientation to portrait
		set data format to binary data
		set resolution to 600
		set page position to center horizontal
		set separation to false
		set print colors to composite CMYK
		
	end tell
end tell




--CREATE 3 text boxes
tell page 1 of document 1
	make text box at beginning with properties {bounds:{"10 mm", "10 mm", "20 mm", "70 mm"}, locked:true}
end tell
tell page 1 of document 1
	make text box at beginning with properties {bounds:{"30 mm", "10 mm", "40 mm", "70 mm"}, locked:true}
end tell
tell page 1 of document 1
	make text box at beginning with properties {bounds:{"50 mm", "10 mm", "60 mm", "70 mm"}, locked:true}
end tell

--CREATE 3 more text boxes
tell page 1 of document 1
	make text box at beginning with properties {bounds:{"10 mm", "80 mm", "20 mm", "170 mm"}, locked:true}
end tell
tell page 1 of document 1
	make text box at beginning with properties {bounds:{"30 mm", "80 mm", "40 mm", "170 mm"}, locked:true}
end tell
tell page 1 of document 1
	make text box at beginning with properties {bounds:{"50 mm", "80 mm", "60 mm", "170 mm"}, locked:true}
end tell

do updates

tell default document 1
	set page height to oldHeight
	set page width to oldWidth
	set automatic text box to oldAutoTextBox
	set guides showing to oldGuidesShowing
	set horizontal measure to xDocMeasure
	set vertical measure to yDocMeasure
end tell

end tell
[/code:1:af0c7bb995]

dus als je vanaf een x en y waarde een text of picture box wil maken kan dat maar met 1..?

ik vind het een beetje onhandig als je iets van 4 text boxen wilt plaatsen, dat je dan vanaf de nul door moet rekeken voor elke text box.

maar het ziet ernaar uit dat ik mijn rekenkunsten uit de kast moet gaan halen :wink:

bedankt voor je hulp!

ik heb werkelijkwaar geen idee wat je bedoelt

@ Walinsky,

Super, bedankt ik kan het wel gebruiken.

als je een text box vanaf een x waarde wilt maken (10 mm) dan lukt dat wel met 1 text box. wil ik vervolgens een 2e maken, dan wordt hij binnen de 1e geplaatst.

als je de text boxen vanaf de nul laat aanmaken, dan kan je ze wel onder elkaar en naast elkaar plaatsen, maar dan moet je iedere keer vanaf de nul doorrekenen
Bijv.: text box 1: {bounds:{10, 10, 40, 50}} maakt een text box van 30 bij 40, terwijl je 40 en 50 hebt opgegeven voor de hoogte en breedte.
als je dan een text box eronder wilt plaatsen krijg je: text box 2: {bounds:{50, 10, 80, 50}}

zo moet je dan steeds doorrekeken.

als je ze gewoon vanaf de x en y waardes kon laten beginnen, dan zou je niet steeds door hoeven te rekenen.

[quote:782f7e8796="Frederick"]Bijv.: text box 1: {bounds:{10, 10, 40, 50}} maakt een text box van 30 bij 40, terwijl je 40 en 50 hebt opgegeven voor de hoogte en breedte. [/quote:782f7e8796] je hebt geen 40 en 50 opgegeven voor de hoogte en breedte; je hebt de bounds van de box aan gegeven in y en x coordinaten! {bounds:{10, 10, 40, 50}} geeft de rechthoek aan tussen het punt (Y1,X1)=(10,10) en (Y2,X2)=(40,50)

[quote:782f7e8796=“Frederick”]als je ze gewoon vanaf de x en y waardes kon laten beginnen, dan zou je niet steeds door hoeven te rekenen.[/quote:782f7e8796]
Ze beginnen gewoon vanaf de x en y waarden; en ze eindigen bij het tweede paar x en y waarden

daar heb je helemaal gelijk in

maar waarom is het niet mogelijk om text boxen onder elkaar te zetten met de code

[code:1:3473144bfb]tell page 1 of document 1
make text box at beginning with properties {bounds:{"0 mm", "0 mm", (newHeight as string) & "mm", (newWidth as string) & "mm"}, locked:true}
end tell[/code:1:3473144bfb]

is het dan juist de bedoeling om de bounds aan te geven van de text boxen, omdat je dan de x en y coordinaten per box aan geeft?

[code:1:47869ce98d] --CREATE 2x3 text boxes set tWidth to 40 set tHeight to 20 set xStart to 10 set yStart to 10

tell page 1 of document 1
	make text box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + tHeight) as string) & " mm", ((xStart + tWidth) as string) & " mm"}, locked:true}
end tell

set xStart to 10
set yStart to 50
tell page 1 of document 1
	make text box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + tHeight) as string) & " mm", ((xStart + tWidth) as string) & " mm"}, locked:true}
end tell

set xStart to 10
set yStart to 90
tell page 1 of document 1
	make text box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + tHeight) as string) & " mm", ((xStart + tWidth) as string) & " mm"}, locked:true}
end tell

set xStart to 100
set yStart to 10

tell page 1 of document 1
	make text box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + tHeight) as string) & " mm", ((xStart + tWidth) as string) & " mm"}, locked:true}
end tell

set xStart to 100
set yStart to 50
tell page 1 of document 1
	make text box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + tHeight) as string) & " mm", ((xStart + tWidth) as string) & " mm"}, locked:true}
end tell

set xStart to 100
set yStart to 90
tell page 1 of document 1
	make text box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + tHeight) as string) & " mm", ((xStart + tWidth) as string) & " mm"}, locked:true}
end tell

[/code:1:47869ce98d]

hoe komt het eigenlijk dat je zo bruut veel weet van AppleScript?

deze doet inderdaad wat ik bedoelde…
sorry voor m’n onhandige en onduidelijke uitleg :oops:

heel erg bedankt voor de moeite :slight_smile:

als je vaste afstanden hebt kun je het nog een stuk korter doen: [code:1:f3baabbd92] --CREATE 2x6 text boxes set tWidth to 40 set tHeight to 20 set xStart to 10 set yStart to 10

repeat with i from 1 to 6
	tell page 1 of document 1
		make text box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + tHeight) as string) & " mm", ((xStart + tWidth) as string) & " mm"}, locked:true}
	end tell
	set yStart to yStart + 40
end repeat

set xStart to 100
set yStart to 10

repeat with i from 1 to 6
	tell page 1 of document 1
		make text box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + tHeight) as string) & " mm", ((xStart + tWidth) as string) & " mm"}, locked:true}
	end tell
	set yStart to yStart + 40
end repeat

[/code:1:f3baabbd92]

ik zie het.

dit heb ik nu voor het aanmaken van een document met text en pcture boxen

[code:1:25c55cfe1c]set newWidth to 210
set newHeight to 297

tell application "QuarkXPress Passport™"
activate

tell default document 1
	set oldHeight to page height
	set oldWidth to page width
	set oldAutoTextBox to automatic text box
	set oldGuidesShowing to guides showing
	set xDocMeasure to horizontal measure
	set yDocMeasure to vertical measure
	set page height to (newHeight as string) & " mm"
	set page width to (newWidth as string) & " mm"
	set automatic text box to false
	set guides showing to true
	set horizontal measure to millimeters
	set vertical measure to millimeters
	
end tell
make document at beginning

tell document 1
	set view scale to fit page in window
	tell print setup
		--try setting the best possible printer 
		set Printerlist to printer type list
		set printer_count to the count of the Printerlist
		set PrintReady to false
		repeat with i from 1 to the printer_count
			set this_printer to item i of the Printerlist
			if this_printer is equal to "Linotronic 630 V 3.3 J" then
				set PrintReady to true
				set printer type to this_printer
			end if
		end repeat
		
		set registration marks to centered
		set registration marks offset to 0
		--set paper height to (newHeight + 12 as string) & "mm" 
		set paper width to (newWidth + 13 as string) & "mm"
		set orientation to portrait
		set data format to binary data
		set resolution to 600
		set page position to center horizontal
		set separation to false
		
	end tell
end tell



--CREATE text and picture boxes 
set tWidth to 40
set tHeight to 15
set pWidth to 140
set pHeight to 15
set xStart to 10
set yStart to 10

tell page 1 of document 1
	make picture box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + tHeight) as string) & " mm", ((xStart + tWidth) as string) & " mm"}, locked:true}
end tell

set xStart to 10
set yStart to 30
tell page 1 of document 1
	make picture box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + tHeight) as string) & " mm", ((xStart + tWidth) as string) & " mm"}, locked:true}
end tell

set xStart to 10
set yStart to 50
tell page 1 of document 1
	make picture box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + tHeight) as string) & " mm", ((xStart + tWidth) as string) & " mm"}, locked:true}
end tell

set xStart to 60
set yStart to 10

tell page 1 of document 1
	make text box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + pHeight) as string) & " mm", ((xStart + pWidth) as string) & " mm"}, locked:true}
end tell

set xStart to 60
set yStart to 30
tell page 1 of document 1
	make text box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + pHeight) as string) & " mm", ((xStart + pWidth) as string) & " mm"}, locked:true}
end tell

set xStart to 60
set yStart to 50
tell page 1 of document 1
	make text box at beginning with properties {bounds:{(yStart as string) & " mm", (xStart as string) & " mm", ((yStart + pHeight) as string) & " mm", ((xStart + pWidth) as string) & " mm"}, locked:true}
end tell

do updates

tell default document 1
	set page height to oldHeight
	set page width to oldWidth
	set automatic text box to oldAutoTextBox
	set guides showing to oldGuidesShowing
	set horizontal measure to xDocMeasure
	set vertical measure to yDocMeasure
end tell

end tell[/code:1:25c55cfe1c]

werkt prima :slight_smile:

en zo kan je ook meerdere pagina’s maken, toch?

tenminste, dat ik dan in dezelfde script “make document” zet voor het maken van een nieuw pagina.
of is dat dan “make new page”

als dat de bedoeling is, is het sneller om een 'loop' te gebruiken; [code:1:825f844750] --CREATE text and picture boxes set tWidth to 140 set tHeight to 15 set pWidth to 40 set pHeight to 15 set txStart to 60 set pxStart to 10 set yStart to 10 set yStep to 20 set boxCounter to 0

repeat with i from 1 to 3
	set boxCounter to boxCounter + 1
	tell page 1 of document 1
		make text box at beginning with properties {name:"textbox" & (boxCounter as string), bounds:{(yStart as string) & " mm", (txStart as string) & " mm", ((yStart + tHeight) as string) & " mm", ((txStart + tWidth) as string) & " mm"}, locked:true}
		
		make picture box at beginning with properties {name:"picturebox" & (boxCounter as string), bounds:{(yStart as string) & " mm", (pxStart as string) & " mm", ((yStart + pHeight) as string) & " mm", ((pxStart + pWidth) as string) & " mm"}, locked:true}
	end tell
	set yStart to yStart + yStep
end repeat

repeat with i from 1 to boxCounter
	tell page 1 of document 1
		set thisBox to object reference of text box ("textbox" & i as string)
		tell thisBox
			set story 1 to i as text
		end tell
	end tell
end repeat

[/code:1:825f844750]
zoals je ziet heb ik er ook nog object-referenties aan toegevoegd; je kunt dan altijd nog specificaties van objecten wijzigen (in dit geval heb ik text in de textboxen geplaatst)
hieromheen kun je nog een loop schrijven die nieuwe [u:825f844750]pagina’s[/u:825f844750] aanmaakt;
hiervoor zou je ook een counter kunnen aanmaken; je kunt de pagina dan bij nummer ‘vastpakken’

als je nieuwe pagina's maakt met de counter, komen die dan ook in hetzelfde document te staan of worden er dan gewoon nieuwe documenten aangemaakt?

nou; nog een keer een lap code:

[code:1:7a04bc349f]
–Quark variables
set newWidth to 210 --pagewidth
set newHeight to 297 --pageheight
set paperBleed to 6.5 --paperbleed (in mm)
set printingBleed to 3 --printing bleed (in mm)
set regMarkOffset to 10 --registration marks offset (pts)
set tWidth to 140 --texboxwidth
set tHeight to 15 --texboxheight
set pWidth to 40 --picturboxwidth
set pHeight to 15 --pictureboxheigth
set txStart to 60 --start value text box on x-axis
set pxStart to 10 --start value picture box on x-axis
set yStart to 10 --whitespace on top of document
set yStep to 20 --whitespace between page objects
set myFont to “Geneva” --the font we’re going to use
set myFontSize to “13pt” --and the size
set textColorValues to {0, 0, 0, 100} as list --cmyk color values for text (percent)
set printerPPD to “Linotronic 630 V 3.3 J” --of course you choose your own preferred ppd here
set rowsPerPage to 14
–don’t edit variables below unless you know what you’re doing

–fill user defined variables
try
tell application "Finder" to set the picFolder to (choose folder with prompt "Selecteer een map met afbeeldingen") as alias
try
set picList to list folder picFolder without invisibles
on error
display dialog "Error! could not set piclist to list folder" buttons {"Exit"} default button 1 with icon stop
return
end try
on error
display dialog "Error! could not set alias for chosen folder" buttons {"Exit"} default button 1 with icon stop
return
end try
set boxCounter to 0 --we have no boxes yet
set currentQuarkPage to 1 – on making a new document Quark generates first page itself
set numImages to count picList
set numPages to round_up(numImages / rowsPerPage)
set quarkTextColorValues to quarkCMYK(textColorValues) --calculate according to Quark values
tell application "QuarkXPress Passport™"
activate

tell default document 1
	set oldHeight to page height
	set oldWidth to page width
	set oldAutoTextBox to automatic text box
	set oldGuidesShowing to guides showing
	set xDocMeasure to horizontal measure
	set yDocMeasure to vertical measure
	set page height to (newHeight as string) & " mm"
	set page width to (newWidth as string) & " mm"
	set automatic text box to false
	set guides showing to true
	set horizontal measure to millimeters
	set vertical measure to millimeters
end tell
make document at beginning

tell document 1
	set view scale to fit page in window
	tell print setup
		--try setting the best possible printer 
		set Printerlist to printer type list
		set printer_count to the count of the Printerlist
		set PrintReady to false
		repeat with i from 1 to the printer_count
			set this_printer to item i of the Printerlist
			if this_printer is equal to printerPPD then
				set PrintReady to true
				set printer type to this_printer
			end if
		end repeat
		set registration marks to centered
		set bleed to printingBleed
		set registration marks offset to regMarkOffset
		--set paper height to (newHeight + 12 as string) & "mm" 
		set paper width to (newWidth + (2 * paperBleed) as string) & "mm"
		set orientation to portrait
		set data format to binary data
		set resolution to 600
		set page position to center horizontal
		set separation to false
	end tell
	
	tell document 1
		--make new color spec
		set mycolorspecs to make new color spec at beginning with properties {name:"mytextcolor", separation:true, color type:CMYK type, CMYK color value:quarkTextColorValues}
		--make new char spec
		set mycharspecs to make new character spec at beginning with properties {name:"mycharspecs", font:myFont, color:"mytextcolor", size:myFontSize}
		--make new style spec
		set newstylespec to make new style spec at beginning with properties {name:"mystylespec", character style:mycharspecs}
	end tell
	
	
end tell


repeat with p from 1 to numPages
	set currentyStart to yStart
	--verify how many rows we're gonna make
	if (currentQuarkPage < numPages) then
		set rowsThisPage to rowsPerPage
	else
		set rowsThisPage to numImages mod rowsPerPage
	end if
	--CREATE text and picture boxes 
	repeat with i from 1 to rowsThisPage
		set boxCounter to boxCounter + 1
		tell page currentQuarkPage of document 1
			make text box at beginning with properties {name:"textbox" & (boxCounter as string), bounds:{(currentyStart as string) & " mm", (txStart as string) & " mm", ((currentyStart + tHeight) as string) & " mm", ((txStart + tWidth) as string) & " mm"}, locked:true}
			set thistBox to object reference of text box ("textbox" & boxCounter as string)
			tell thistBox
				--import and format text here
				set story 1 to (item boxCounter of picList as string) as text
				set style sheet of paragraphs of story 1 to newstylespec
			end tell
			
			make picture box at beginning with properties {name:"picturebox" & (boxCounter as string), bounds:{(currentyStart as string) & " mm", (pxStart as string) & " mm", ((currentyStart + pHeight) as string) & " mm", ((pxStart + pWidth) as string) & " mm"}, locked:true}
			set thispBox to object reference of picture box ("picturebox" & boxCounter as string)
			tell thispBox
				--import pic here
				set image 1 to ((picFolder as string) & (item boxCounter of picList as string)) as alias
				set bounds of image 1 to proportional fit
			end tell
		end tell
		set currentyStart to currentyStart + yStep
	end repeat
	--add page to document
	if currentQuarkPage < numPages then
		tell document 1
			make page at end
		end tell
		set currentQuarkPage to currentQuarkPage + 1
	end if
	do updates
end repeat
--set default document to initial values
tell default document 1
	set page height to oldHeight
	set page width to oldWidth
	set automatic text box to oldAutoTextBox
	set guides showing to oldGuidesShowing
	set horizontal measure to xDocMeasure
	set vertical measure to yDocMeasure
end tell

end tell

–functions

–round_up returns highest integer next to given ‘this_number’
on round_up(this_number)
set rounded to round (this_number)
if rounded < this_number then
set rounded to rounded + 1
end if
return rounded
end round_up

–calculate CMYK color values according to Quark
on quarkCMYK(percentage_values)
if (count of percentage_values) is not 4 then
display dialog "Error! need 4 values (0-100) for CMYK" buttons {"Ok"} default button 1 with icon stop
return
end if
set quarkValues to {} as list --safer to construct new list than editing values while looping
repeat with eachPercentage in percentage_values
set thisValue to (eachPercentage / 100 * 65535)
copy thisValue to the end of quarkValues
end repeat
return quarkValues
end quarkCMYK

[/code:1:7a04bc349f]

wow, wacht eens even..

hiermee kan ik gewoon meerdere afbeeldingen tegelijk importeren!

hoe is dat nu mogelijk…? :smiley:
ik ga even je script analyseren.