Re: Bare Bones Backup Button
- To: mathgroup at smc.vnet.net
- Subject: [mg77581] Re: [mg77536] Bare Bones Backup Button
- From: DrMajorBob <drmajorbob at bigfoot.com>
- Date: Wed, 13 Jun 2007 07:34:25 -0400 (EDT)
- References: <200706080938.FAA03696@smc.vnet.net> <200706090943.FAA17991@smc.vnet.net> <acbec1a40706090337i64852d8cja3b1b942c7b29fec@mail.gmail.com> <06D466A7-0D44-40DB-ACB5-F488E9D2B08B@mimuw.edu.pl> <acbec1a40706090412u7c2da126nf291c7d4628d7c4a@mail.gmail.com> <14694989.1181527374589.JavaMail.root@m35> <200706110827.EAA21339@smc.vnet.net> <3306125.1181629909918.JavaMail.root@m35> <op.ttswj8btqu6oor@monster.ma.dl.cox.net> <31952022.1181659012658.JavaMail.root@m35>
- Reply-to: drmajorbob at bigfoot.com
That works, but it maks no sense for two reasons:
1) Documentation says Saveable->True is the default, and
2) judging from its behavior, the option should be =
"SaveableWithoutMovingItFirst->True".
Bobby
On Tue, 12 Jun 2007 08:55:48 -0500, Selwyn Hollis <sh2.7183 at earthlink.ne=
t> =
wrote:
> Bobby,
>
> Thanks again for the Windows repairs. On the saveability issue, wrap =
> SetOptions around it with the option Saveable->True.
>
> -Selwyn
>
>
> On Jun 12, 2007, at 4:58 AM, DrMajorBob wrote:
>
>> That doesn't work in Windows ($HomeDirectory is read-only, among othe=
r =
>> things), but this does:
>>
>> CreatePalette[{Button["Bare Bones Backup",
>> Module[{filename, thisnb = InputNotebook[]},
>> If[thisnb =!= $Failed,
>> CreateDirectory[
>> ToFileName[{$UserBaseDirectory, "MathBackups"}]];
>> filename =
>> StringJoin[
>> StringReplace[(WindowTitle /. AbsoluteOptions[thisnb]),
>> s_ ~~ ".nb" -> s], "_",
>> StringJoin[ToString /@ Round /@ Rest[Date[]]], ".nb"];
>> Export[
>> ToFileName[{$UserBaseDirectory, "MathBackups"}, filename],
>> DeleteCases[NotebookGet[thisnb], Cell[_, "Output", ___],
>> Infinity]]]]]}];
>>
>> Execute the code, and it creates the palette. Now... and this is =
>> dumb... grab the palette and move it. Then close it, and Mathematica =
=
>> asks if you want to save the palette.
>>
>> If you DON'T move it, there's no way (I can find) to save the palette=
. =
>> Using Selwyn's CreateDocument version, even moving the palette doesn'=
t =
>> work.
>>
>> I discovered the needed changes by trial and error; the documentation=
=
>> was no help at all. There are dozens of palette and notebook creation=
=
>> examples, but none of them (that I could find) show how to save the =
>> result.
>>
>> Bobby
>>
>> On Tue, 12 Jun 2007 00:23:53 -0500, Selwyn Hollis =
>> <sh2.7183 at earthlink.net> wrote:
>>
>>> This is something I've wanted for years. Click the button, and a cop=
y
>>> of the current InputNotebook -- with output cells deleted -- is
>>> Exported into a backup folder in your $HomeDirectory.
>>>
>>> CreateDocument[PaletteNotebook[
>>> Button["Bare Bones Backup",
>>> Module[{filename, thisnb = InputNotebook[]},
>>> If[thisnb =!= $Failed,
>>> CreateDirectory[ToFileName[{$HomeDirectory, "MathBackups"}]];
>>> filename = StringJoin[
>>> StringReplace[(WindowTitle /. AbsoluteOptions[thisnb]),
>>> s_ ~~ ".nb" -> s], "_",
>>> StringJoin[ToString /@ Round /@ Rest[Date[]]], ".nb"];
>>> Export[ToFileName[{$HomeDirectory, "MathBackups"}, filename],
>>> DeleteCases[NotebookGet[thisnb], Cell[_, "Output", ___],
>>> Infinity]]
>>> ] ] ] ] ]
>>>
>>> (Button is new to 6, but the function inside Button should work fine=
>>> in 5.2.)
>>>
>>> I've got a version of this that runs automatically every 15 minutes
>>> (you can change the interval, of course). Anyone who's interested
>>> should let me know.
>>>
>>> Selwyn Hollis
>>>
>>>
>>
>>
>>
>> --DrMajorBob at bigfoot.com
>
>
-- =
DrMajorBob at bigfoot.com
- Follow-Ups:
- 3D plot with one logarithmic axes
- From: "Carabe - Fernandez, Alejandro" <a.carabe@imperial.ac.uk>
- 3D plot with one logarithmic axes
- References:
- Re: Re: v6: still no multiple undo?
- From: "Barthelet, Luc" <lucb@ea.com>
- Re: Re: Re: v6: still no multiple undo?
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Re: Re: Re: Re: v6: still no multiple undo?
- From: DrMajorBob <drmajorbob@bigfoot.com>
- Re: Re: v6: still no multiple undo?