[texhax] Executing a script with \href{run:script.sh}

Henrik Frisk frisk.h at gmail.com
Mon Oct 4 10:47:35 CEST 2010


> I've fought over this for a few years, and having solved it along the
> lines you tried it stopped working. I give below a recipe I found on the
> web that works for me. For security I give my scripts a unique ending,
> so that it doesn't open acroread up to executing a potentially
> malicious .sh file. Let's say you use .mysh as a file type, i.e.,  your
> scripts are named myscript.mysh
>
> Now, here's the recipe of what I did:
>
> 1. added
>
> <mime-type type="application/mysh">
> <comment>Movie Shell Script</comment>
> <expanded-acronym>MY mysh</expanded-acronym>
> <magic priority="50">
> <match value="\x47\x3f\xff\x10" type="string" offset="0"/>
> <match value="0x000001b3" type="big32" offset="0"/>
> <match value="0x000001ba" type="big32" offset="0"/>
> </magic>
> <glob pattern="*.mysh"/>
> </mime-type>
>
> to /usr/share/mime/packages/freedestop.org.xml
>
> 2. sudo update-mime-database /usr/share/mime/    [as directed above]
>
> 3  opened nautilus, selected one of my .mysh scripts and set /bin/sh as
> the custom command to open it. T
> his then works with acroreader AND okular AND evince but NOT kpdf.
>
> [I suspect the magic section is designed to peer into an mpeg file and
> recognise it, but it doesn't seem
> to confuse my system so I'll leave it for now...]
>
> I suspect this works better because it adds the mimetype in the right
> place(s). Maybe this will work for you.
>

Hi Steve, and sorry for my slow response on this... This was very
valuable information, thanks a lot! Let's hope that embedding videos
in PDFs will soon be possible with less trouble.

> PS Ah I see you've solved it differently, but the above will avoid
> having to do it with individual files. I put the mplayer options in my
> scripts. Also I have tried to get them to autoplay but failed. Let me
> know if you solve this one. But you will also need to autostop them or
> you may find your presentation grinding to a halt with half a dozen
> movies continuing to play
>
I'll let post on this list if I figure out how to autoplay.

best,

/Henrik



More information about the texhax mailing list