[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] PNG selection export (was Re: Beginner questions (cro

From: Lib Lists
Subject: Re: [Denemo-devel] PNG selection export (was Re: Beginner questions (cross-staff, PNG selection export, feathered beams, batch export, Print View behaviour))
Date: Fri, 16 Aug 2019 09:47:31 +0200

On Thu, 15 Aug 2019 at 12:59, Richard Shann <address@hidden> wrote:
> On Tue, 2019-08-13 at 10:56 +0200, Lib Lists wrote:
> > > > Hi, writing in a terminal '/PATH/TO/Preview somefile.png' doesn't
> > > > work. However, 'open -a  /PATH/TO/Preview somefile.png' works as
> > > > well
> > > > as 'open somefile.png'.
> > >
> > > In that case you may be able to set the Image Viewer field to
> > > "open"
> > > without the quotes
> > > and it may work. (I'm hoping there is an executable named "open"
> > > that
> > > takes a filename as a parameter and decides what to do with it)
> > >
> >
> > Hi, I tried but it doesn't work, same result as before. I tried
> > 'open', 'open -a PATH/TO/Preview'. Here the
> > man page for 'open'
> > In the preferences I also setup an
> > internet browser ('PATH/TO/Safari) and I found a problem: Safari
> > correctly opens, but the address to the file (the help file in this
> > case) is written as:
> > file:///file:/Applications/
> > /manual/denemo-manual.html
> > with the double 'file' bit at the beginning. Maybe related with the
> > problem with Preview?
> Well, this sounds like it is not difficult to fix: Denemo is
> successfully launching the executable program, but the programs
> launched are failing to pick up and use the parameter appropriately. In
> the case of Safari it is taking the parameter to be a file name and
> prefixing file:/// to it while how the "open" thing is failing is less
> clear, as the man page you quote indicates that calling it with a pdf
> filename as parameter should work. Setting the field to 'open -a
> PATH/TO/Preview' would *not* work, as it would try to execute a program
> named 'open -a PATH/TO/Preview' which doesn't exist.
> So the easy fix is to create a script that calls the program you want
> to call with the correct parameter. On Unix you would write a file
> containing something like
> 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> #!/bin/bash
> echo Opening $1 as png using the command: open -a /PATH/TO/Preview $1
> open -a /PATH/TO/Preview $1
> 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> you would put this into a file, say and make it executable
> chmod a+x
> You could use any other scripting language to take the file name as
> provided by Denemo and invoke your display program.

Hi Richard,
thank you, but unfortunately it didn't work. I get the same result as
before (pop-up saying 'Your PNG file has now been created).

> However, it sounds like "open" may not behave like a normal executable
> program, and a quick search for Preview on the MacOS suggests that you
> cannot invoke it with an option to provide the filename that Preview is
> to work on - is there a man page for Preview? - so if that is really
> the case, bizarre as it seems, then you might have to write an
> AppleScript or use some more normal display program.

I'm quite sure it is possible to invoke it with a filename. In fact
'open filename' is the same as double-clicking on the file (see
attached man page for open), it'll open the file with the default
application, while 'open -a appname filename' opens filename with the
application appname.



> Richard

Attachment: open.1
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]