indesign cs horizontal scale?

An error which didnt occur in ind2 is:
set horScale to (horizontal scale of page item 1)

„InDesign CS“ hat einen Fehler erhalten: „horizontal scale of page item 1 of rectangle 2 of last page of active document“ kann nicht gelesen werden.

whats the new word for “horizontal scale” or is there another error?

and by the way: where do all this " «event K2 fitc» given «class givn»:content to frame"-lines come from (i don’t remember them with indesign 2) and what do they mean?

1- the same.
2- no doubt.
3- these are changed terms. Your editor does not recognise the AppleScript command for this apple event. So it shows the command in “source code”.
«event K2PIfitc» equals ‘fit’
«class givn» equals ‘given’
so your line is the “source code” for the command ‘fit mybox given content to frame’
4- Please translate if you want us to help you!

thank you so far.
which OSX-scripteditor can open older scripts without displaying source code?
Or what do the following lines mean in applescript?:
«event K2 dupe»
«event K2 plac»
«class imot»
«class insh»
(Is the sourcecode documented somewhere?)

the error-message is:
„horizontal scale of page item 1 of rectangle 2 of last page of active document“ can not be read.
Any ideas what could be wrong?

Have you tried:

P.S. It is a bit hard to help you if you don’t post a hole code…

Kari

hi kari,
thanks, graphic item works, how did you know (are the script-changes from ind2 to cs documented somewhere)?

To clean up/rebuild my code I would like to know what the following lines mean in applescript?:
«event K2 dupe»
«event K2 plac»
«class imot»
«class insh»

Probably something like this:

«event K2 dupe» = duplicate
«event K2 plac» = place
«class imot» = showing options (boolean)
«class insh» = on (reference)

Check this:
http://scriptingmatters.com/adobe_indesigncs.shtml

P.S. Once again; If you would post your code so far, you would get more response.

Kari

thanks again, it all works, the only remaining source code is:
«event K2 fitc» given «class givn»:center content
whats the normal applescriptcode of “center content”?

here’s the whole script:
tell application “InDesign CS”

set i to 2
-- Dupliziere abwechselnd eine andere von mehreren (hier = 4) Musterseiten 
set m to 1
repeat
	if m = 1 then
		duplicate first page of active document
	end if
	if m = 2 then
		duplicate second page of active document
	end if
	if m = 3 then
		duplicate third page of active document
	end if
	if m = 4 then
		duplicate fourth page of active document
	end if
	set m to (m + 1)
	if m = 5 then
		set m to 1
	end if
	
	-- Zeige eine Textauswahldialogbox an
	set textdateiwahl to (choose file) as text
	tell text import preferences
		set character set to DOS latin 2
		set platform to PC
	end tell
	
	tell active document
		--lade den text
		place textdateiwahl on text frame "Marketing" of last page without showing options
		set active spread of window 1 to parent of last page
		(*set mystory to parent story of last page
		tell mystory*)
		
		tell parent story of text frame "Marketing" of last page
			set applied paragraph style to "Grundtext"
			--suche und ersetze die abschnittstrenner durch spaltenwechsel
			set suche0 to search for "Brand:" & return
			delete suche0
			
			set suchen to search for "Name:" & return
			set contents of item 1 of suchen to column break
			
			set suche to search for return & "Kontakte:" & return
			set contents of item 1 of suche to column break
			
			set suche1 to search for return & "Text deutsch" & return & return & "history:" & return
			set contents of item 1 of suche1 to column break
			
			set suche2 to search for "kollektion:" & return
			set contents of item 1 of suche2 to column break
			
			set suche3 to search for return & "highlights:" & return
			set contents of item 1 of suche3 to column break
			
			set suche4 to search for return & "Text englisch" & return & return & "history_en:" & return
			set contents of item 1 of suche4 to column break
			
			set suche5 to search for return & "kollektion_en:" & return
			set contents of item 1 of suche5 to column break
			
			set suche6 to search for return & "highlights_en:" & return
			set contents of item 1 of suche6 to column break
			
			set suche7 to search for return & "marketing:" & return
			set contents of item 1 of suche7 to column break
			
			--	set triplereturn to (return & return & return)
			--	delete (every text whose contents = triplereturn)
		end tell
		
		set i to i + 3
		
		-- brandnamen stilvorlagen entsprechend umformatieren
		(* Damit die Textrahmen so angesprochen werden können, müssen die Musterseiten einmalig vorher per script entsprechend benannt werden*)
		tell first paragraph of text frame "Brandname" of last page
			set applied paragraph style to "Brandname"
		end tell
		tell text of text frame "Highlights" of last page
			set applied paragraph style to "Highlights"
		end tell
		tell text of text frame "History" of last page
			set applied paragraph style to "History"
		end tell
		tell text of text frame "Kollektion" of last page
			set applied paragraph style to "Kollektion"
		end tell
		tell text of text frame "Highlights_en" of last page
			set applied paragraph style to "Highlights"
		end tell
		tell text of text frame "History_en" of last page
			set applied paragraph style to "History"
		end tell
		tell text of text frame "Kollektion_en" of last page
			set applied paragraph style to "Kollektion"
		end tell
		
		-- dupliziere den markennamen entsprechend dem layout
		set markenname to first paragraph of text frame "Brandname" of last page
		set contents of text frame "Brandname_w" of last page to markenname
		tell text of text frame "Brandname_w" of last page
			set applied paragraph style to "Brandnamew"
		end tell
		
		-- wähle die logodatei per dialogbox und passe sie dem rahmen an
		set logodateiwahl to (choose file)
		place logodateiwahl on second rectangle of last page
		tell second rectangle of last page
			fit given content to frame
			set horScale to (horizontal scale of graphic 1)
			set vertScale to (vertical scale of graphic 1)
			if horScale is greater than vertScale then
				set horizontal scale of graphic 1 to vertScale
				set vertical scale of graphic 1 to vertScale
			else
				set vertical scale of graphic 1 to horScale
				set horizontal scale of graphic 1 to horScale
			end if
		end tell
		
		-- wähle die bilddatei per dialogbox und passe sie dem rahmen an
		set bilddateiwahl to (choose file)
		place bilddateiwahl on fourth rectangle of last page
		tell fourth rectangle of last page
			fit given content to frame
			set horScale to (horizontal scale of graphic 1) + 0.1 -- add 0.1 % 
			set vertScale to (vertical scale of graphic 1) + 0.1 -- add 0.1 % 
			if horScale is greater than vertScale then
				set vertical scale of graphic 1 to horScale
				set horizontal scale of graphic 1 to horScale
			else
				set horizontal scale of graphic 1 to vertScale
				set vertical scale of graphic 1 to vertScale
			end if
			«event K2  fitc» given «class givn»:center content
		end tell
	end tell
	--set savename to (path to desktop as string) & "bb_test.indd"
	--		save active document in savename
	
	save active document
end repeat

end tell

«event K2 fitc» given «class givn»:center content

fit given center content

Kari

thanks, thats it