How would i get a script to continue after the user has selected files

Hi all

How would i get a script to continue after the user has selected files in quark I then need to continue after the file has opened ?

Say if the user has been prompted to select some files and then opens them I want my script to pause while the user is opening the files and then continue once they are opened exporting them to a new file format.

I take it it would be some sort of “If file window exists” or something in that line?

Thanks again you guys are always I great source of information.

Cheers

David

Isn’t it easier to run a script, which prompts the user to choose the files and process them without any further user interaction?

Hi Stefan

That was my original idea I wanted to have the user select the folder with the files to be processed and then the script does the rest.

However if you have a look at my code:

try
set the this_folder to POSIX(choose folder with prompt “Please select the folder which contains the Indesign files to convert”) as alias
on error
set the this_folder to path to desktop as alias
end try

tell application “Finder” to set the_files to every file of the this_folder whose name extension is “qxp”
repeat with oneFile in the_files
tell application “QuarkXPress”
activate
delay 5
tell application “QuicKeys”
play shortcut named “ID2Q Open”
quit
end tell
[user to select files here]
end tell
end repeat

I am using quickeys to access a quark extension that I cannot access with AS or GUI AS. It brings up I file open dialog box but i dont know how to pass the path set in the beginning to the dialog box. Is is possible to do this?

Cheers

David

sorry, GUI scripting advices aren’t possible without having the apps to test the code
I don’t have Quark, so I can’t see and say anything.

But if QuicKeys can access the extension, GUI scripting probably also can

Thanks for the help.

What I would like to know is how would i set the path of a file —> open dialog in the main menu of and mac application to a path I specify without user interaction?

EG if I if i set the constant folder to 1 as alias
the when file open is clicked through GUI the current path of the window will be alias ?

Cheers again!

the keystroke ⇧⌘G in a open/save dialog opens a sheet, there you can insert the (POSIX) path

thanks very much that is very helpful!!!

You can probably see i only started using mac a month ago!!!

Must say Im enjoying it!

Just one more question for today!

How would I pass the POSIX PATH to the dialog box open by the command shift g keystroke?

Thanks again

with GUI scripting like


tell application "System Events"
	tell process "someProcess"
		tell window "whatever"
			keystroke "g" using {command down, shift down}
			repeat until exists sheet 1
				delay 0.5
			end repeat
			tell sheet 1
				keystroke "/path/to/folder"
				click button "Go"
				delay 0.5
			end tell
		end tell
	end tell
end tell

Hi Stefan, David,
I wonder if it would be better to use the default location and of type in the choose file options

set DefualtFolder to "Macintosh HD:Users:UserName:QuarkFileFolder:" as alias
--tell application "Finder"
	set theFiles to choose file with prompt "the prompt to be displayed in the dialog box" of type {"public.jpeg"} default location DefualtFolder with multiple selections allowed without invisibles
--end tell

To get the file type use:

set TheType to type identifier of (info for (choose file))

I know, but David wants something to accomplish with a QXP extension,
but I’m not sure, where in the script the file/folder path must be specified

A link to the list of dialogs that you would need to navigate:
http://www.designerchain.com/markzware/id2q.php?id=iq203#features
David, I am a Quark user and have GUI scripted several things that I have had no access to via the dictionary. IMO this would be very tricky task to do. I can’t help as I don’t have your version of Quark or the XT in question. XT developers can add extra commands and make them available to the host app but in your case they have not done so. Getting through this sort of stuff is messy and unreliable at best.

Hi guys

I work for a travel company as a DBA. The scenario is as follows:

We use Postscript files as the format for our travel documents issued to our clients. These documents are printed automatically out of a custom in-house system running off ORACLE. When the file is printed for the customer the software opens the PS file searches for a specific string and replaces it with the passenger’s name, converts to a PDF using GhostScript and the prints or emails the file.

Now the problem lies in the fact that postscript code generated out of any Adobe product or any Quark product above version 6.5 positions text absolutely so if the name of the passenger is longer than that the string that the software searches for it bunches the name or visa versa stretches it. Postscript out of Quark 6.5 or earlier does not position its text absolutely so it allows us to do this search and replace without any effect on the resulting PDF file.

The Graphic designers use Indesign to create these documents so:

  1. I bought a converter (ID2Q) from Markzware that uses Quark 7 to convert Indesign docs to Quark Format.
  2. I then back version save the file as a Quark 6.0 project file from Quark 7.
  3. I then convert the the Quark 6 file to Postscript using Quark Xpress Passport 6.5

So what I need is to automate this process. I could do it manually but there are ± 2000 files and they get updated constantly due to prices changes and exchange rates and so on so I need to automate this so that it is a matter of select the file and the Mac does the rest.

Am I just jerking off? Is this at all possible??

I would also like to say that there is a promotion in line for me if I remedy this current document nightmare we are experiencing. So I am quite eager to solve this (if possible)

Hope this was not too long winded.

Again your help is greatly appreciated.

Cheers

Dave