Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Not Working for Me' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Not Working for Me
Authored by: readparse on Feb 19, '03 12:42:11PM

First of all, being a unix guy, I don't think in terms of aliases, but rather symlinks. I finally realized that a symlink wasn't going to do the trick, but an alias does. At least as far as launching an Application. OK, fair enough. I think a symlink oughta work, but no big deal.

I would REALLY like to get a perl or shell script working, but no luck so far. And believe me, I've tried just about everything. I first tried just putting the executable script directly in ~/Library/PDF Services and nothing. Then when I realized that only aliases (and not symlinks) to applications worked, I figured maybe I had to use an alias to my script instead of having the script directory in the PDF Services directory (which would seem weird). Regardless, any way that I try it doesn't work.

By the way, just so you know what I'm doing. In order to verify that the script is running, the only thing that the script does is create a file and put into the file all the arguments that the script got. In any case, the file isn't even being created, which indicates that the script is not running (it's supposed to create it in /var/tmp so permissions aren't an issue). I've tested the script and I know it should be working... it's just not.

Any ideas?



[ Reply to This | # ]
Not Working for Me
Authored by: Graff on Feb 19, '03 08:36:17PM
    I would REALLY like to get a perl or shell script working, but no luck so far. And believe me, I've tried just about everything.
Well I thought that maybe you needed to name the script with a .sh extension so that the Finder knows to execute the script, but you don't need to. All you need to do is to make it executable with a "chmod +x filename" and the script will run just fine.

I made up this little shell script to test this:

#!/bin/sh
#
# Input parameter:
# $3 - path to the document's location as a temp file

mv "$3" ~/Desktop/


This moves the temp file created by the PDF Services to the current user's desktop. Not too useful since using an alias to the desktop works more easily than using a script. The important thing is to remember that the PDF services is creating a temp document, storing it somewhere, and passing the file name and path to the shell as the the third input parameter.

Go to this Apple documentation page for more info on creating PDF Workflow Options. Particularly interesting is this statement:
A UNIX tool or tool alias triggers an action by the tool on the PDF file. Tools are passed three parameters:
   • the title of the PDF document
   • a string that specifies the CUPS options for the job
   • the path to the spooled PDF file

This means that the name will be in the variable $1, the CUPS options will be in $2, and the file path will be in $3. Remember, since the file is in a temp directory you are responsible for cleaning it up, if you need to delete it (that is, your action on it didn't remove it from the temp directory) then just put this statement at the end of your script:

rm -f "$3"

[ Reply to This | # ]
symlinks work for me
Authored by: kyrrigle on Feb 20, '03 09:55:38AM

mkdir ~/Library/PDF\ Services
cd ~/Library/PDF\ Services
ln -s '/Applications/Acrobat Reader 5.0.app' 'Open With Acrobat.app'
ln -s ~/Documents 'Save in Documents'

works like a charm...



[ Reply to This | # ]