PDA

View Full Version : AppleScript Brisque workflow


bytejockey
02-21-2006, 07:56 PM
Does anyone have a snippet of AS code for Preps 5.1 to place a ".job" file in the filelist (and/or runlist) using Brisque workflow?

TIA
Jeff

barak.paltiel
02-22-2006, 05:50 PM
Hello Jeff

Can you please give more specific details of your request?

Best Regards

P. Barak

bytejockey
02-22-2006, 06:21 PM
Here is the basic script I'm trying to address:
-----------------------
tell application "Finder" to set DisICFSource to ("brisque03.2.0:Test:001.job:" as alias)
tell application "Preps 5"
activate
close every job
set DisJob to make new job with properties {workflow:ICF, name:"Fred"}
make new signature in DisJob with properties {template:"Test", name:"Full Signature"}
set default bleed margin of job 1 to 18
save job 1
tell front job to set DisJobfile to insert page 1 of DisICFSource in filelist
end tell
-----------------------
I get an error saying Preps can't get the file. The path is valid, pointing to a .job file/folder on the Brisque server. The attached is the actual error screen capture.

tim.bogomolov
02-23-2006, 10:22 PM
It looks for me that we can not use alias or folder with Preps and we should enter the exact path to the file we want to use. That path should be just string and look like "Drive:Folder:OneMoreFolder:YourFile.pdf".
---
I've never worked with Brisque workflow but I think this should help.
---
set DisICFSource to "brisque03.2.0:Test:001.job:"
tell application "Preps 5"
activate
close every job
set DisJob to make new job with properties {workflow:ICF, name:"Fred"}
make new signature in DisJob with properties {template:"Test", name:"Full Signature"}
set default bleed margin of job 1 to 18
save job 1
set DisJobfile to insert (DisICFSource & "YourFileName.pdf") at the end of filelist with replacing without adding to runlist
end tell

bytejockey
02-24-2006, 12:03 AM
Thanks Tim, alas that has been tried. The issue is in Isreal at this time.

Jeff

ssutton
03-23-2006, 05:39 PM
Jeff,

I recently spent a fair amount of time writing a script for Preps. If you think it would help you to have a copy, let me know and I will email it to you. The script pulls in a number of PDFs, then inserts a particular page from each PDF, prints the job to a PJTF (into a particular folder) and finally saves the Preps job (again, into a particular folder).

As a possible solution suggestion, how about instead of actually trying to write the path into the script, try picking the file via a choose file dialog box. Something like:

set DisICFSource to choose file

That way you can see what is actually going on and if the script works you will know the proper format for the path; i.e. - whether you need to use an alias or not. You might also want to throw in a dialog box that will show what the path is like:

display dialog DisICFSource

Or, you could stop the script after the choose file and see what is displayed in the results window of the Script Editor. When I was writing my script, I found that sometimes I could use an alias and sometimes I couldn't. I don't know enough about AppleScript or scripting Preps to know why, I just left it at 'this works so leave it alone!'

Hope this helps,
Steven

bytejockey
03-23-2006, 09:34 PM
Have you been successful at placing a .job file into a Preps runlist using AS? If so, then I would be very interested in seeing the code you used to accomplish this.

Jeff

ssutton
03-23-2006, 10:50 PM
Jeff,

I am beginning to think I may not be understanding what you are trying to accomplish. When you say that you want to place a ".job" file into a Preps runlist you lose me. A ".job" file IS a Preps file. How can you place a Preps job into a Preps job? What I did learn that might be of interest to you is that you can't tell Preps to Open a Preps job. I tried many versions of

tell application "Preps 5"
open "MyHD:Test.job"

and it never worked. I finally found out that to open an existing Preps job you have to do this:

set source_folder to choose folder with prompt "Select a folder containg Preps documents"
set dest_folder to choose folder with prompt "Select a destination folder"
set item_list to list folder source_folder without invisibles
repeat with i from 1 to number of items in the item_list
set this_item to item i of items in the item_list
set the_file to source_folder & this_item as string

tell application "Finder"
open file the_file
end tell

tell application "Preps 5"
print the front job saving as job ticket saving in dest_folder
close the front job
end tell

end repeat

This was a script I wrote to open existing Preps jobs and print them to PJTF files. Hope there is something here that helps.

Steven

bytejockey
03-24-2006, 04:55 PM
This involves a Brisque RIP and Brisque workflow, specifically the “job” files created by the RIP, not the Preps “.job” files - I may not have been clear. In reality the Brisque “job” files are folders containing CT & LW files (RIPed data). The problem seems that Preps AS wants to see a “file” and the object is a folder.

One can drag & drop or navigate using the usual Preps interface functions, but the AS implementation for this seems to be confused because of the above and/or it's just plain busted.

Jeff

ssutton
03-24-2006, 06:00 PM
Oh. Not having Brisque, I am a little unfamiliar with the file naming and how the whole package works. But, if this .job is actually a folder I wonder if you could treat it as such. For example, try setting th epath to the folder (.job thingy) like this:

set theFolder to choose folder with prompt "Select the .job file"

Then in the Preps section of the AppleScript you could loop through the folder adding its contents:

tell application "Preps 5"
Make new job with properties{workflow:ICF}
set source_folder to theFolder as alias
set the item_list to list folder source_folder without invisibles
set source_folder to source_folder as string
repeat with i from 1 to number of items in the item_list
set this_item to item i of the item_list
set this_item to (source_folder & this_item) as alias
insert this_item at the end of the filelist with replacing without adding to runlist
end repeat

I have to admit that I am just copying pieces from the Preps script that I wrote in hopes that it might give you a clue how to acheive what you are trying to do. If I had Brisque, maybe I could write the actual code you need....maybe. The only other thing I will toss in here at this time is that in my script I sometimes had to convert the folder path I chose to text and use the path as text and sometimes I had to convert it back to a path to make it work. I don't really know why. That was one of the reasons I was suggesting earlier that you try selecting the job file manually (ie - through a choose folder or choose file dialog) so you could see if you needed to add the job 'file' or if you needed to choose it as a folder and add its contents.

steven

bytejockey
03-24-2006, 08:12 PM
Hi Steven

Thanks for looking at this. Your approach is right. If the object that Preps AS was looking for were a folder, then this would work just fine. However, Preps AS is looking for a file and the “Brisque Job” is a collection of files – a folder. Manual selection of a “Brisque Job” is no problem – it’s scripting the “Brisque Job” selection that is foiled by Preps AS looking for a file object. Specifically it’s in the command: “insert this_item in runlist” that fails – “this_item” MUST be a file with Preps AS. But by using the interface one can drag or nav to a folder – no problem. At least that’s my bet when this is all said and done.

If you have any ideas on how to address a folder as a file object, or scripting using Brisque workflow specifically, I would like to hear about it. However, I have spent many hours mutating the ways of addressing the “Brisque Job” using AS, and the result is the same – Preps AS is broken on this point. That seems to play out with the guys in Isreal as well. But I’m all ears if anyone has anything else on this matter.

Jeff