QuarkExpress problem setting up .eps file

I think i do something wrong here, i want to hardwire
a .eps file like this but it doesn’t do the thing i want

tell page 1 of document 1
set newBox to make new picture box at beginning with properties �
{bounds:{“0 mm”, “0 mm”, “297 mm”, “210 mm”}, color:“wit”}
select newBox
set image 1 of newBox to (“Dolf HD:Desktop Folder:IN:” whose name ends with {“.eps”})
end tell

or

tell page 1 of document 1
set newBox to make new picture box at beginning with properties �
{bounds:{“0 mm”, “0 mm”, “297 mm”, “210 mm”}, name:“ImportHere”}
set image 1 of picture box “ImportHere” to (“Dolf HD:Desktop Folder:IN” whose name ends with {“.eps”})
select newBox
end tell

Who can help me ?

Call the Finder first :

tell application “Finder”
set this_file to name of first file of folder “Dolf HD:Desktop Folder:IN” whose name ends with “.eps”
end tell

then replace
whose name ends with {“.eps”}
in line 5 of your second script
by
& this_file

You forgot to write it, i suppose you are working with X-Press ?

many thanks for your response

sorry, yes indeed this is a code for QuarkXpress
I did what you suggested but i get a syntax error on “image 1” in the code

set image 1 of picture box “ImportHere” to “Dolf HD:Desktop Folder:IN” & this_file

and when i do it this way:

set image of “ImportHere” to “Dolf HD:Desktop Folder:IN” & this_file

then syntax is OK only i get this in my event dialog

tell application “Finder”
get name of file 1 of folder “Dolf HD:Desktop Folder:IN” whose name ends with “.eps”
→ “10714770.eps”
→ “Dolf HD:Desktop Folder:IN10714770.eps” kan niet worden toegekend aan image of “ImportHere”.

I do not understand why the script can’t import the image
maybe you’ve another suggestion ???
:oops:[/b]

Hi

IN is a folder. So you have to write :

set image 1 of picture box “ImportHere” to “Dolf HD:Desktop Folder:IN:” & this_file

i forgot the “:” after “IN”. :oops:

Tot ziens

thanks again…

I did this already but still i get a error on “image 1”

I will show you below the code in whole,

tell application “QuarkXPress Passport™ 4.11”
activate
set thePath to “:”

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 "297 mm"
	set page width to "210 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
end tell
tell page 1 of document 1
	set newBox to make new picture box at beginning with properties ¬
		{bounds:{"0 mm", "0 mm", "297 mm", "210 mm"}, name:"ImportHere"}
	select newBox
	
	tell application "Finder"
		set this_file to name of first file of folder "Dolf HD:Desktop Folder:IN" whose name ends with ".eps"
		set image 1 of picture box "ImportHere" to "Dolf HD:Desktop Folder:IN:" & this_file 
		end tell
end tell

end tell

I want to make this script to attach it to a folder action, so when i save a .eps file
it will import itself in a new Quarkdoc.

I feel i almost there, with al litllehelp

Does it work when you change these two lines?
(Don’t have Q4 to test it)
Kjeld

set this_file to first file of folder "Dolf HD:Desktop Folder:IN" whose name ends with ".eps"
set image 1 of picture box "ImportHere" to alias ("Dolf HD:Desktop Folder:IN:" & this_file) 

You are telling the Finder to do the job of XPress with this:


tell application "Finder" 
set this_file to name of first file of folder "Dolf HD:Desktop Folder:IN" whose name ends with ".eps" 
set image 1 of picture box "ImportHere" to "Dolf HD:Desktop Folder:IN:" & this_file 
end tell 

Call the Finder first !
this works for me (tested X-Press 4.0)


tell application "Finder"
	set this_file to name of first file of folder "MacOS 9.2:Desktop Folder:IN" whose name ends with ".eps"
end tell
tell application " Passport™ 4.04 no dongle"
	activate
	tell page 1 of document 1
		set newBox to make new picture box at beginning with properties ¬
			{bounds:{"0 mm", "0 mm", "297 mm", "210 mm"}, name:"ImportHere"}
		select newBox
		set image 1 of picture box "ImportHere" to "MacOS 9.2:Desktop Folder:IN:" & this_file
	end tell
end tell

Tot ziens

Yoohoo !!! Jodelatiehie !!!

Wow it works, thank you very much macscripters
:smiley: