Workflow Idea

Hello,

I am quite new to this whole AppleScripting thing and have just writen my first script!! It alows me to drag and drop Quark files or a folder onto the script droplet, it then opens each file up, it reads the page size and adds 10mm, prints to a ps file with all my settings and save to a watched folder and then distiler does its magic and I end up with a PDF.

Now I want to take it 1 stage further! How can I drag an entire artwork folder onto the script, it then creates a Font Set in Suitcase Fusion containing all the fonts that were in the folder, then moves all the images out of the images folder and places them in the same folder as the Quark file, then auto Updats any pictures, then runs my previous script!

Does this sound to taxin for AppleScript?? :smiley:

I don’t have Suitcase Fusion, but your quest begins with the question “Is SF scriptable? (does it have an AppleScript dictionary with elements that will do what you want)”

Hi,

It does yes! Here is a bit of it:

Standard Suite Common terms for most applications
close‚v : Close an object
close reference : the objects to close
count‚v : Return the number of elements of a particular class within an object
count reference : the object whose elements are to be counted
each type class : the class of the elements to be counted
→ integer : the number of elements
data size‚v : Return the size in bytes of an object
data size reference : the object whose data size is to be returned
→ integer : the size of the object in bytes
exists‚v : Verify if an object exists
exists
→ boolean : true if it exists, false if not
get‚v : Get the data for an object
get reference : the object whose data is to be returned
→ anything : The data from the object
make‚v : Make a new element
make
new type class : the class of the new element
[at location reference] : the location at which to insert the element
[with properties record] : the initial values for the properties of the element
→ reference : Object specifier for the new element
delete‚v : delete item from database
delete
open‚v : Open the specified object(s)
open reference : Objects to open. Can be a list of files or an object specifier.
print‚v : Print the specified object(s)
print reference : Objects to print. Can be a list of files or an object specifier.
set‚v : Set an object’s data
set reference : the object to change
to anything : the new value
move‚v : move the item
move reference : the object to move
to reference : where to move the item to
[from reference] : where to move item from if it is in more than one location
application‚n : An application program
elements
contains file, Font Sets, Fonts.
properties
Server Subscription Enabled (boolean) : is server subscription enabled?
Font Server Address (international text) : DNS or IP address of the font server
Font Server Directory (alias) : Folder where server fonts are stored.
Last Update Time (date, r/o) : The last time the server subscription was updated.
Subscription Update Success (integer, r/o) : 0 indicates never tried, 1 indicates success, negative numbers count the number of failed re-tries.
Frequency Is Time Of Day (boolean) : Is the subscription update frequency a time of the day?
Subscription Update Frequency Seconds (integer) : Update frequency in seconds either as a cycle time or, if Frequency Is Time Of Day, a positive offset from midnight.
Subscription Update Frequency (Q3FR) : Update frequency record
User Name (international text) : User name for connecting to font server
User Password (international text) : User password for connecting to font server
Subscription Update In Progress (boolean) : Tells whether files are currently being downloaded. Set to true to force an immediate subscription update. Set to false to abort a download in progress.
Keep Log (boolean) : Keep a log file
System font scan in progress (boolean) : Tells whether system fonts are currently being scanned. Set to true to force an immediate scan. Set to false to abort a scan in progress.
Auto-activation (integer) : enable auto-activation
Auto-activation font preference (integer) : When auto-activating fonts. 1:prefer PostScript, 2:prefer TrueType
System conflict override (boolean) : Override any system font conflicts.
window‚n : A Window
properties
bounds (bounding rectangle) : the boundary rectangle for the window
closeable (boolean, r/o) : Does the window have a close box?
titled (boolean, r/o) : Does the window have a title bar?
index (integer) : the number of the window
floating (boolean, r/o) : Does the window float?
modal (boolean, r/o) : Is the window modal?
resizable (boolean, r/o) : Is the window resizable?
zoomable (boolean, r/o) : Is the window zoomable?
zoomed (boolean) : Is the window zoomed?
name (international text) : the title of the window
visible (boolean, r/o) : is the window visible?
position (point, r/o) : upper left coordinates of window
document‚n : A Document
properties
name (international text, r/o) : the title of the document
modified (boolean, r/o) : Has the document been modified since the last save?

These Dictionaries make no sense to me, can you point me in the right direction? :confused:

Thanks for the quick reply by the way!!

Hi,

That’s the problem. When you don’t have a good teacher, then you’,re doomed to a life of other people haveing to write your scripts for you.

So, how do you learn? Experiment man!

BTW, make your own system on writing your oiwn scripts.

gl,

Ok, good answer!

Without sounding too lazy… can I have a starting point… I am not the sort of person who RTFM’s!! (Reads the Manual!) :wink:

I learn better as you said by experimenting as I found with my last script, I learnt more from compositing other scripts to make mine.

Once I get to grips with the Language I am sure I will soon be dragging and dropping my work onto an Icon and sitting back and watching!!! :lol:

There’s the problem!

Your script is a composition of what you got from here and there. Yet you have not tried to understand what those scripts mean.

If you want to live a life of asking other people what things mean, then so be it. If you want to do it yourself, then you gotta learn to debug your own scripts.

One path is easy, but not always consistant, and the other path is hard, but knowledage gives you consistancy.

It’s your choice man.

gl,

I try to teach other people how to write their own scripts, so they don’t always ask the same questions.

The “Standard Suite” is common to many applications, but only allows opening and closing windows, etc. What you need is a Suite labeled “Suitcase Fusion suite” containing terms (the commands and descriptive terms, verbs and nouns if you like) for doing the SF operations you need.

My script is awsome and works like a dream and took me only a few hours to compile, I debugged it quite a bit and, as I said, learnt a lot doing it, and again as I mentioned before, I learn a lot quicker by decompiling other peoples work it gives you a good base.

This script writing is not my job and I am only using it to help my day to day work, I do not have the luxury of time on my side…

Thanks for all your replys and I appriciate exactly what you are saying and it sounds like you dont like people like me who use bits of other peoples scripts, but this is an open source comunity and if anyone wants my script I “wrote”, I would be happy to share it!! :slight_smile:

Now then, can anybody help? or point me to a peice of starting code to get me on my way?

Excellent Thanks Adam, I will get stuck in Thanks again!

If anyone else would like to add that would be great!

Kel, Teach me then Man!!

Hey Baldie,

I forget if that was your name:D. Using already made scripts are good. But, if you try to understand what they do, then you can learn a lot. Then, you rewrite them in your own style.

Just wanting to is a good start. That’s how Adam learned.

gl,

I can teach you how to save scripts! I can teach you how to use manuals! I can teach you how to read dictionaries! That’s about all you need for AppleScript.

I am very supprised actualy how easy these scripts are too write and how powerfull they are!! Exciting times for me, I juust need to catch up with you lot!! :wink:

I have got this far so far:

tell application “Suitcase Fusion”

set newSet to make new Font Set with properties {name:this_item}
set addedFonts to (add jobFonts in newSet with temporary)
repeat with thisFont in addedFonts
	try
		set activation status of thisFont to activated temporarily
	end try
end repeat

end tell

:smiley:

What else do you want to learn about Baldie?

I’m open to any question right now!

gl,

What’s so great about that script?

Ah. the simplicicity. You are definitely an AppleScripter, to be or whatever.

No this is my new script which I am writing from scratch…

Here is my other script:

– This droplet processes both files or folders of files dropped onto the applet
on open these_items

set Destination to "G5 HD:Users:me:My Work:PDF Creation:Press Ready:In:"

repeat with i from 1 to the count of these_items
	set this_item to (item i of these_items)
	set the item_info to info for this_item
	
	if folder of the item_info is true then
		process_folder(this_item, Destination)
	else if (alias of the item_info is false) then
		my process_item(this_item, Destination)
	end if
end repeat

end open

– this sub-routine processes folders
on process_folder(this_folder, Destination)
set these_items to list folder this_folder without invisibles
repeat with i from 1 to the count of these_items
set this_item to alias ((this_folder as text) & (item i of these_items))
set the item_info to info for this_item
if folder of the item_info is true then
process_folder(this_item, Destination)
else if (alias of the item_info is false) then
my process_item(this_item, Destination)
end if
end repeat
end process_folder

– this sub-routine prints the files
on process_item(this_item, Destination)
tell application “Finder”
open item this_item
try
set docName to name of file this_item as text
–display dialog File_Name as text
on error
display dialog “Problem getting file name.”
end try
end tell
tell application “QuarkXPress Passport”
– activate
tell document 1
– set docName to name of document 1
set MyDocWidth to ((width of bounds of current page) as millimeter units) as real
set MyDocHeight to ((height of bounds of current page) as millimeter units) as real
tell print setup
set printer type to “Acrobat Distiller CMYK”
set paper size to “Custom”
set print spreads to false
set separation to false
set fit in area to false
set reduce or enlarge to “100%”
set paper width to (MyDocWidth + 20) as millimeter units
set paper height to (MyDocHeight + 20) as millimeter units
set bleed to 3 as millimeter units
set orientation to portrait
set page position to center position
set print colors to composite CMYK
set resolution to 2400
set registration marks to centered
set registration marks offset to “6pt”
set include blank pages to true
set tiling to off
end tell

		set filePath to Destination & docName & ".ps"
		print PostScript file filePath without print dialog
		close saving no
	end tell
end tell

end process_item

:slight_smile: