MACSCRPT Archives

August 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Lloyd Butler <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 24 Aug 2007 07:57:03 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (102 lines)
Levon,

I think the others have pointed out your Finder solutions, or gotten 
you very close. You were on the right track, but needed to do it in 3 
steps rather than one,  does folder exist? - create it - copy the files 
to it.

On the Quark side, I have had issues getting Quark to return the real 
values from text or picture boxes if they are not currently on the 
screen.

I have found that if I have the script open the doc, and then display 
it to fit to the window so that the entire page is visible, then I get 
accurate results back when talking to the text and picture boxes.

I would suggest adding that to your script just after it is opened so 
that you do not get some false answers and end up chasing ghosts. Sorry 
I don't have the exact code in from of me, but you can find it in the 
dictionary of the App.

Lloyd Butler


On Aug 22, 2007, at 10:00 PM, MACSCRPT automatic digest system wrote:

> From: Levon Spradlin <[log in to unmask]>
>
> I am trying to update an OS 9 script for Quark to use in OS X. I think 
> I
> have the general idea down, but I know I am missing a few details. This
> script is supposed to check for images that are out of the 85-100% 
> range and
> drop them into a sub-folder to correct. I have it working to the point 
> of
> getting the Quark files and opening, then closing. What I am having 
> trouble
> with is getting the script to communicate to the Finder that a new 
> folder
> needs to be created if the files are out of the range. I am also having
> trouble updating the syntax to get the scale of the images in picture 
> boxes.
>
> If anyone has a bit of guidance, I would really appreciate it.
>
> thanks,
> Levon
>
> [applescript]
> (**
> This script does the following:
> Open a folder and check the contents for Quark files
> See if any art placed in picture boxes in Quark is less than 85% or 
> greater
> than 100%
> Close without saving
> Place these items in a sub-folder to manually correct
> **)
>
> set FileSample to choose folder
> set folderName to name of (info for FileSample)
> tell application "Finder" to set theFiles to files of folder FileSample
> whose name extension is in {"qxd"} or kind contains "QuarkXPress" or 
> file
> type is in {"XPRJ", "XPR3"}
> repeat with oneFile in theFiles
>     tell application "QuarkXPress"
>         activate
>         open (oneFile as alias)
>         tell front document
>             set docName to name
>             repeat with i from 1 to count of picture boxes
>                 try
>                     set theScale to scale of image 1 of picture box i 
> as
> list
>                     set thisScale to (item 1 of theScale)
>                     set imagePath to file path of image 1 of picture 
> box i
>                     set imageName to my pathName(imagePath)
>                     if thisScale as real is less than "85" or 
> thisScale as
> real is greater than "100" then
>                         tell application "Finder"
>                             (move oneFile to folder) make new folder at
> folderName with properties {name:"Incorrectly Scaled Files"}
>                         end tell
>                         display dialog "There are files out of scale 
> range
> in the folder 'Incorrectly Scaled Files.' Please manually fix the 
> files and
> then re-run this script."
>                     end if
>                 end try
>             end repeat
>             close saving no
>         end tell
>     end tell
> end repeat
> [/applescript]
>
> Levon Spradlin

ATOM RSS1 RSS2