Re: PDF Services - I'm lost...
Re: PDF Services - I'm lost...
- Subject: Re: PDF Services - I'm lost...
- From: Michael Cytrynowicz <email@hidden>
- Date: Tue, 12 Aug 2003 03:26:34 +0200
Matthew - thanks for responding!
Yes, I am aware of the way PDF Services work - I've been pdf printing
to folder aliases placed in the PDF Services folder in my Library.
What I am having trouble is with creating a script which will do the following:
(1) print to pdf to any folder of my choice and right after
(2) copy the newly created pdf's name to the clipboard
I tried saving a script to the PDF Services folder that was like this:
on open these_items
set the clipboard to first item of these_items as text
end open
And, printing from Safari, I get this:
Dodecaide:private:tmp:printing.1136.2:Print job.pdf
The pdf is spooled to the tmp folder, with name "Print job.pdf"
If I run Apple's Mail script, it attaches to a new mail, equally, a
pd file with name "Print job.pdf"
However, if instead of "printing" to a script, I print to a folder
(through its alias placed in PDF Services folder) - then I get,
correctly a pdf file whose name is the title of the corresponding
Safari page.
Any ideas?
Best,
Mike
At 03:05 +0200 8/12/03, Michael Cytrynowicz wrote:
>
on 12/08/2003 10:17, Michael Cytrynowicz at email@hidden wrote:
>
>
> No responses to my earlier post - so I tried to figure it out by
>
> myself, but, I can't - so if any charitable soul is willing to lend
>
> me a hand, I'd be most grateful.
>
>
>
> The issue is, using PDF Services to print from Safari, how can I get
>
> (clipboard, etc) the title of the pdf that was just printed. I
>
> create folder actions to do it (reporting a file newly added and
>
> returning its name) but its a clunky workaround.
>
>
>
> From the ADC, I got some information (see below) on scripting PDF
>
> Services, but I really couldn't understand exactly what application
>
> is doing what. Hm. Looking at the attach to mail script provided by
>
> Apple didn't enlighten me either. It has the handler:
>
>
>
> on open these_items
>
> ...
>
> end open
>
>
>
> I suppose these_items is a list, right? I tried a number of
>
> variations to get the name or properties, or anything from the first
>
> item in the list - but nada, zero. I am beginning to feel very dumb.
>
> What am I missing?
>
>
I think you misunderstand what PDF Services is. PDF Services are not invoked
>
when something is printing. You invoke a PDF Service from the print dialog
>
instead of printing. There is a button at the bottom of the window that pops
>
up a menu of the services. You choose one of them. The print subsystem
>
creates a PDF which you can then process. This is done by passing a list
>
containing an alias to the PDF file to the "on open" handler"
>
>
So for the example of attaching the file to a mail message. What you do is
>
go to print a document. Instead of hitting the Print button in the print
>
dialog, you choose the PDF Service from the popup menu button in the bottom
>
of the dialog. A PDF file is created and the "on open" handler is called in
>
the PDF Service, with the parameter being a list containing only the alias
>
to the PDF file. The script then uses the alias (the first item of the list)
>
to attach it to a mail message.
>
>
Note that your script must delete the PDF file after you have finished
>
working with it.
>
>
--
>
Matthew Smith
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.