Re: "Save file with" dialog box
Re: "Save file with" dialog box
- Subject: Re: "Save file with" dialog box
- From: "Gary (Lists)" <email@hidden>
- Date: Sat, 25 Aug 2007 10:39:56 -0400
"email@hidden" wrote:
> What I have below works up to the point where the dialog box appears, a new
> name is entered, and a destination folder is selected. At that moment I get an
> error message stating that it "Can't get document of 'fileName'". Now I've
> probably overlooked something very simple, so please forgive the elementary
> error:
>
> set fileName to (text returned of (display dialog ¬
> "Save file as:" default answer ""))
> set fileName to the fileName
> save document of the fileName in (choose folder)
> close document "ScheduleMaster"
> beep 2
There's really no way you could expect that to do anything.
I don't anything about Quark. Alas, the problems with this script have
nothing to do with Quark.
> set fileName to (text returned of (display dialog ¬
> "Save file as:" default answer ""))
> set fileName to the fileName
'fileName' is a string (big hint: it's the text returned).
Why do you set 'fileName' to ' the fileName'? That's redundant and useless.
> save document of the fileName in (choose folder)
A string of text does not have a 'document', so there is no 'document of'
that string.
> close document "ScheduleMaster"
What you likely wish to do is along the lines of 'save document
"ScheduleMaster" in file fileName.
But, of course, you still haven't provided an actual path at which to save
something. You only have a string that is the name of the to-be-saved file.
'choose folder' is going to give you a path to the folder AS AN ALIAS.
You need to determine what Quark needs as the parameters for its 'save'
command. At this point, you have the ability to put a string version of the
folder alias together with the file name the user provided to construct a
full path. Or, maybe Quark asks for the path and the file name as separate
strings. Either way, Quark's dictionary should be your next stop.
> beep 2
Beep. Beep.
--
Gary
P.S.
You can turn off the AOL 18pt text when posting to this list. Plain text is
normative. Reasonably styled rich-text is generally accepted without
complaint (thanks to Apple's Mail.app encouraging such irritating behavior).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden