• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Opening all Quark docs in a designated folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening all Quark docs in a designated folder


  • Subject: Re: Opening all Quark docs in a designated folder
  • From: JJ <email@hidden>
  • Date: Tue, 13 Mar 2001 10:12:33 +0100

> Message: 6
> From: email@hidden
> To: email@hidden
> Date: Mon, 12 Mar 2001 16:50:16 -0700
> Subject: Re: Opening all Quark docs in a designated folder
>
> I'm a newbee so take it easy on me if this is an easy question.
>
> I have about 50 Quark documents that I go through and make global changes to.
> I
> wrote a script that makes the global changes to the Quark documents but I can
> only get it to do one at a time. I have all the files in one folder and I
> would
> like the script to open all the Quark files in that folder first before making
> the global changes. I thought about merging all the files into one document
> but
> they have to stay separate documents.
>
> Any help would be appreciated

In order to proccess a lot of files I use to make a droplet with this
structure:

on open (theitems)
tell application "Finder"
activate
try
set (theitems) to selection
repeat with i from 1 to count of items in (theitems)
if class of item i of (theitems) is folder then
my folderaction(theitems) -- for batch-processing items
in a folder
else
if class of item i of (theitems) is document file then
my fileaction(theitems) -- for batch-processing
single files
end if
end if
exit repeat
end repeat
on error errtext number errnum
if errnum  -128 then -- user cancelled
display dialog errtext
end if
end try
end tell
end open


on fileaction(theitems)
tell application "Finder"
activate
repeat with i from 1 to the count of items in (theitems)
if file type of item i of (theitems) is in {"XDOC"} then
set theFile to item i of (theitems)
tell application "QuarkXPress"
activate
open (filePath) use doc prefs yes remap fonts no do auto
picture import no
-- YOUR SCRIPT
end tell
end if
end repeat
end tell
end fileaction

on folderaction(theitems)
tell application "Finder"
activate
repeat with y in (theitems)
repeat with x from 1 to the count of items in contents of y
if file type of item x of y is in {"XDOC"} then -- Quark
document
set theFile to item x of y
tell application "QuarkXPress"
activate
open theFile use doc prefs yes remap fonts no do
auto picture import no
-- YOUR SCRIPT
end tell
end if
end repeat
end repeat
end tell
end folderaction

Now you can drag & drop hundreds of files or a folder full of files.
(If you drop "hundreds" of files you should increase your droplet memory!)

JJ


  • Prev by Date: RE: Mounting volumes
  • Next by Date: Re: detect launch of file?
  • Previous by thread: Re: Opening all Quark docs in a designated folder
  • Next by thread: Script's Stack Overflowed???
  • Index(es):
    • Date
    • Thread