Re: Excel and Quark
Re: Excel and Quark
- Subject: Re: Excel and Quark
- From: Stan Cleveland <email@hidden>
- Date: Thu, 30 Apr 2009 16:01:14 -0700
- Thread-topic: Excel and Quark
Title: Re: Excel and Quark
On 4/30/09 1:57 PM, "Nate Battles" wrote:
I need to get contents of specific columns and rows in an Excel sheet and place that content into a specific text box within a file in Quark. How should I proceed? So copy contents of column “FileType” and place in textBox “FileType”
Hi, Nate. The code below shows in simple terms how to retrieve data from Excel 2004 or 2008, a row at a time.
set startRow to 2
set endRow to 25
repeat with thisRow from startRow to endRow
tell application "Microsoft Excel"
set {{sport, type, product, retail, wholesale}} to formula of ¬
range ("A" & thisRow & ":E" & thisRow)
--> {{"Soccer", "Balls", "Elite Game Ball", 30.00, 17.50}}
end tell
tell application "QuarkXPress”
-- do Quark stuff here
end tell
end repeat
If you need to grab a column at a time, it would look something like the code below. Note that Excel returns a list of lists in both examples. Each sub-list represents one row, while each value in a sub-list represents one cell.
set colList to {"A", "B", "C", "D", "E"}
set startRow to 1
set endRow to 5
repeat with i from 1 to (count colList)
set thisCol to contents of item i of colList
tell application "Microsoft Excel"
set {{sport1}, {sport2}, {sport3}, {sport4}, {sport5}} to formula of ¬
range (thisCol & startRow & ":" & thisCol & endRow)
--> {{"Soccer"}, {"Baseball"}, {"Football"}, {"Tennis"}, {"Golf"}}
end tell
tell application "QuarkXPress”
-- do Quark stuff here
end tell
end repeat
Hopefully someone else can help with the Quark stuff. I didn’t know anyone was still using Quark. :-∫
HTH,
Stan C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden