Save as avi tries to open new avi

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Save as avi tries to open new avi

Glen MacDonald-2
Hello,
The following line to save an AVI in a macro brings up a dialog window to open an avi.  the line was copied from the Macro Recorder and I only added the text between [].

        run("AVI...","compression=JPEG frame=30 save=["+target+wt+"]”);
where target is the save directory and wt is the window title for the movie.

Fiji, 2.0.0-rc-44/1.50e99, Java 1.8.0_65, OSX10.9.5

Is this a simple syntax error?

thanks,
Glen MacDonald
Digital Microscopy Center
Box 357923
University of Washington
Seattle, WA 98195-7923  USA
(206) 616-4156
[hidden email]

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Save as avi tries to open new avi

Gabriel Landini
On Sunday 07 Feb 2016 11:01:35 you wrote:
> "]”);
One of your quotes (the last one) is not a quote character, although it might
look like one.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Save as avi tries to open new avi

Herbie
In reply to this post by Glen MacDonald-2
Good day Glen,

This works for me:

path = "/Applications/ImageJ/etc";
run("AVI... ", "compression=JPEG frame=30 save=" + path + "/Stack.avi");

HTH

Herbie

::::::::::::::::::::::::::::::::::::::::::::
Am 07.02.16 um 20:01 schrieb Glen MacDonald:

> Hello,
> The following line to save an AVI in a macro brings up a dialog window to open an avi.  the line was copied from the Macro Recorder and I only added the text between [].
>
> run("AVI...","compression=JPEG frame=30 save=["+target+wt+"]”);
> where target is the save directory and wt is the window title for the movie.
>
> Fiji, 2.0.0-rc-44/1.50e99, Java 1.8.0_65, OSX10.9.5
>
> Is this a simple syntax error?
>
> thanks,
> Glen MacDonald
> Digital Microscopy Center
> Box 357923
> University of Washington
> Seattle, WA 98195-7923  USA
> (206) 616-4156
> [hidden email]
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Save as avi tries to open new avi

Glen MacDonald-2
thanks Herbie and Gabriel,
Tested variations of your suggestions and still obtain a dialog to open an avi.
the target directory string already ended in a File.separator, “/“:
        target=dir+basename+"Frequencies"+File.separator;

————extract and rename subset of movie--------
        savefreq=target+getTitle(); //replaced target=target+getTitle();
        run("AVI...","compression=JPEG frame=30 save=“+savefreq+".avi”);  
then stripped off  the File.separator to copy Herbie’s exact syntax,
        run("AVI...","compression=JPEG frame=30 save="+target+"/test.avi”);// target is destination directory

/Users/Histo/Desktop/Frequencies/

Regards,
Glen MacDonald
Digital Microscopy Center
Box 357923
University of Washington
Seattle, WA 98195-7923  USA
(206) 616-4156
[hidden email]








On Feb 7, 2016, at 11:16 AM, Herbie <[hidden email]> wrote:

> Good day Glen,
>
> This works for me:
>
> path = "/Applications/ImageJ/etc";
> run("AVI... ", "compression=JPEG frame=30 save=" + path + "/Stack.avi");
>
> HTH
>
> Herbie
>
> ::::::::::::::::::::::::::::::::::::::::::::
> Am 07.02.16 um 20:01 schrieb Glen MacDonald:
>> Hello,
>> The following line to save an AVI in a macro brings up a dialog window to open an avi.  the line was copied from the Macro Recorder and I only added the text between [].
>>
>> run("AVI...","compression=JPEG frame=30 save=["+target+wt+"]”);
>> where target is the save directory and wt is the window title for the movie.
>>
>> Fiji, 2.0.0-rc-44/1.50e99, Java 1.8.0_65, OSX10.9.5
>>
>> Is this a simple syntax error?
>>
>> thanks,
>> Glen MacDonald
>> Digital Microscopy Center
>> Box 357923
>> University of Washington
>> Seattle, WA 98195-7923  USA
>> (206) 616-4156
>> [hidden email]
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Save as avi tries to open new avi

Gabriel Landini
On Sunday 07 Feb 2016 13:01:12 you wrote:
> thanks Herbie and Gabriel,
> Tested variations of your suggestions and still obtain a dialog to open an
> avi. the target directory string already ended in a File.separator, “/“:
> target=dir+basename+"Frequencies"+File.separator;

I was probably not clear. The last of your quotation marks in the line you
posted had a replaced " character  for a 'smart quote', instead of what you
get by typing shift+2.
Have a look at the attached and see that the last quotation is not the same as
the others.  Did you try replacing it?

I wonder if the interpreter does not recognise it and so gives the error.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Screenshot.png (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Save as avi tries to open new avi

Michael Schmid
In reply to this post by Glen MacDonald-2
Hi Glen,

in addition to the wrong quote mentioned by Gabriel, for saving an AVI, please note that there must be a space at the end of "AVI... "
The menu commands for reading and writing AVI files are distinguished by whether there is a space at the end or not.
Use Plugins>Macros>Record to see the difference.

By the way, having a space at the end or not is used also to distinguish other commands that seem to be identical at first glance, e.g.
importing/saving "Image Sequence...",
importing/saving "Results..."
importing/saving "Text Image..."
importing/saving "XY Coordinates..."
Process>Math>Macro... and Process>Batch>Macro...,
Edit>Options>Reset... and Plugins>Untilities>Reset...
Plugins>New>Table... and File>Import>Table

Michael
________________________________________________________________
On Feb 7, 2016, at 22:01, Glen MacDonald wrote:

> thanks Herbie and Gabriel,
> Tested variations of your suggestions and still obtain a dialog to open an avi.
> the target directory string already ended in a File.separator, “/“:
> target=dir+basename+"Frequencies"+File.separator;
>
> ————extract and rename subset of movie--------
> savefreq=target+getTitle(); //replaced target=target+getTitle();
> run("AVI...","compression=JPEG frame=30 save=“+savefreq+".avi”);  
> then stripped off  the File.separator to copy Herbie’s exact syntax,
> run("AVI...","compression=JPEG frame=30 save="+target+"/test.avi”);// target is destination directory
>
> /Users/Histo/Desktop/Frequencies/
>
> Regards,
> Glen MacDonald
> Digital Microscopy Center
> Box 357923
> University of Washington
> Seattle, WA 98195-7923  USA
> (206) 616-4156
> [hidden email]
>
>
>
>
>
>
>
>
> On Feb 7, 2016, at 11:16 AM, Herbie <[hidden email]> wrote:
>
>> Good day Glen,
>>
>> This works for me:
>>
>> path = "/Applications/ImageJ/etc";
>> run("AVI... ", "compression=JPEG frame=30 save=" + path + "/Stack.avi");
>>
>> HTH
>>
>> Herbie
>>
>> ::::::::::::::::::::::::::::::::::::::::::::
>> Am 07.02.16 um 20:01 schrieb Glen MacDonald:
>>> Hello,
>>> The following line to save an AVI in a macro brings up a dialog window to open an avi.  the line was copied from the Macro Recorder and I only added the text between [].
>>>
>>> run("AVI...","compression=JPEG frame=30 save=["+target+wt+"]”);
>>> where target is the save directory and wt is the window title for the movie.
>>>
>>> Fiji, 2.0.0-rc-44/1.50e99, Java 1.8.0_65, OSX10.9.5
>>>
>>> Is this a simple syntax error?
>>>
>>> thanks,
>>> Glen MacDonald
>>> Digital Microscopy Center
>>> Box 357923
>>> University of Washington
>>> Seattle, WA 98195-7923  USA
>>> (206) 616-4156
>>> [hidden email]
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Save as avi tries to open new avi

Glen MacDonald-2
Thanks Michael,
That was it! Replacing AVI…” with  AVI… “ makes it work.  Looking closely at the macro recorder shows it.  
As soon as I read your reply, I recalled there was a thread on this a couple of years ago.

Regards,
Glen MacDonald
Digital Microscopy Center
Box 357923
University of Washington
Seattle, WA 98195-7923  USA
(206) 616-4156
[hidden email]








On Feb 8, 2016, at 2:48 AM, Michael Schmid <[hidden email]> wrote:

> Hi Glen,
>
> in addition to the wrong quote mentioned by Gabriel, for saving an AVI, please note that there must be a space at the end of "AVI... "
> The menu commands for reading and writing AVI files are distinguished by whether there is a space at the end or not.
> Use Plugins>Macros>Record to see the difference.
>
> By the way, having a space at the end or not is used also to distinguish other commands that seem to be identical at first glance, e.g.
> importing/saving "Image Sequence...",
> importing/saving "Results..."
> importing/saving "Text Image..."
> importing/saving "XY Coordinates..."
> Process>Math>Macro... and Process>Batch>Macro...,
> Edit>Options>Reset... and Plugins>Untilities>Reset...
> Plugins>New>Table... and File>Import>Table
>
> Michael
> ________________________________________________________________
> On Feb 7, 2016, at 22:01, Glen MacDonald wrote:
>
>> thanks Herbie and Gabriel,
>> Tested variations of your suggestions and still obtain a dialog to open an avi.
>> the target directory string already ended in a File.separator, “/“:
>> target=dir+basename+"Frequencies"+File.separator;
>>
>> ————extract and rename subset of movie--------
>> savefreq=target+getTitle(); //replaced target=target+getTitle();
>> run("AVI...","compression=JPEG frame=30 save=“+savefreq+".avi”);  
>> then stripped off  the File.separator to copy Herbie’s exact syntax,
>> run("AVI...","compression=JPEG frame=30 save="+target+"/test.avi”);// target is destination directory
>>
>> /Users/Histo/Desktop/Frequencies/
>>
>> Regards,
>> Glen MacDonald
>> Digital Microscopy Center
>> Box 357923
>> University of Washington
>> Seattle, WA 98195-7923  USA
>> (206) 616-4156
>> [hidden email]
>>
>>
>>
>>
>>
>>
>>
>>
>> On Feb 7, 2016, at 11:16 AM, Herbie <[hidden email]> wrote:
>>
>>> Good day Glen,
>>>
>>> This works for me:
>>>
>>> path = "/Applications/ImageJ/etc";
>>> run("AVI... ", "compression=JPEG frame=30 save=" + path + "/Stack.avi");
>>>
>>> HTH
>>>
>>> Herbie
>>>
>>> ::::::::::::::::::::::::::::::::::::::::::::
>>> Am 07.02.16 um 20:01 schrieb Glen MacDonald:
>>>> Hello,
>>>> The following line to save an AVI in a macro brings up a dialog window to open an avi.  the line was copied from the Macro Recorder and I only added the text between [].
>>>>
>>>> run("AVI...","compression=JPEG frame=30 save=["+target+wt+"]”);
>>>> where target is the save directory and wt is the window title for the movie.
>>>>
>>>> Fiji, 2.0.0-rc-44/1.50e99, Java 1.8.0_65, OSX10.9.5
>>>>
>>>> Is this a simple syntax error?
>>>>
>>>> thanks,
>>>> Glen MacDonald
>>>> Digital Microscopy Center
>>>> Box 357923
>>>> University of Washington
>>>> Seattle, WA 98195-7923  USA
>>>> (206) 616-4156
>>>> [hidden email]
>>>>
>>>> --
>>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>>
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html