Sucking photos out of Quark, compressing and sending the whole mess to the Internet
Sucking photos out of Quark, compressing and sending the whole mess to the Internet
- Subject: Sucking photos out of Quark, compressing and sending the whole mess to the Internet
- From: Christopher Douris <email@hidden>
- Date: Thu, 11 Jan 2001 12:47:40 -0500
I hope someone out there can help us iron out a few bugs in this one. It's
giving us fits.
The Reader's Digest version of the problem is this:
Our newspaper composing room is actually in two offices 40 miles from here
and 30 miles apart. Both are currently sending Quark pages and photos for me
to process using a separate program for sending to the Net. We HAVE to
automate the process as completely as possible.
Here is the script as developed to date hopefully some of you have had
experience with this and can help us out:
set theDestination to choose folder
on adding folder items to theDestination after receiving myNewFiles
tell application "Finder"
duplicate myNewFiles to folder "Watched Folder"
end tell
end adding folder items to
set theDoc to choose file
set theDestination to "Processed for Internet"
tell application "QuarkXPress 4.1"
open theDoc
set imageList to file path of every image of document 1
end tell
tell application "Finder"
activate
duplicate theDoc to theDestination with replacing
--**for some reason this returned an invalid key form**--
repeat with anImage in imageList
try
if anImage exists then
duplicate anImage to theDestination with replacing
end if
on error
set theResponse to display dialog "There is an image missing!"
and (anImage as text) buttons {"Continue", "Cancel"} default button "Cancel"
if button returned of theResponse is "Cancel" then
exit repeat
end if
end try
end repeat
end tell
tell application "StuffIt Deluxe"
activate
make new archive with properties {pathname:"Macintosh HD:Desktop
Folder:YRNG.com.sit"}
stuff {alias "Macintosh HD:Desktop Folder:Processed for Internet:"}
end tell
Fetch take over--
tell application Finder
activate
move (the contents of folder whose file type is not "SIT5") to trash
empty
end tell
tell application "Fetch 3.0.3"
activate
end tell
on open myUploadItem
set myUser to ""
set myPassword to ""
set myHost to "xx.xx.xxx.x"
set myDirectory to "/Internet"
set myURL to "
ftp://" & myUser & ":" & myPassword & "@" & myHost & "/" &
myDirectory
with timeout of 300 seconds
tell application "Fetch 3.0.3"
set myBinPref to the add bin suffix
set the add bin suffix to false
put into url myURL item myUploadItem text format Raw Data binary
format Raw Data
set the add bin suffix to myBinPref
quit
end tell
end timeout
end open