Tobias,
I have tried a few things based on what you said, but couldn't get
anything to work.
I tried putting your code into it's own tiddler. It works except that
the prompt pops up twice. If I hit cancel the 2nd time I get a
''null' is null or not an object' error. There is only one 'null' in
the code and when I remove that it causes a separate error. I'm
trying to get this figured out without help, but I'm coming up a bit
short.
Below is the code (with slight changes for my needs). It works grea
except for the baffling duplicate issue. ((hit 'Enter') is to show
linebreaks).
<script label="New Contact">(hit 'Enter')
var allwaysTag="";(hit 'Enter')
var p=prompt("Please Enter Title;Tag","").split(';');(hit 'Enter')
var title=p[0];if(!title||title=='')return;(hit 'Enter')
var tags=(""+' '+p[1]).readBracketedList();(hit 'Enter')
store.saveTiddler(title, title, "<<tiddler
ContactsFormTemplate>><data>{}</data>", config.options.txtUserName,
new Date(), tags);(hit 'Enter')
story.displayTiddler(null,title);(hit 'Enter')
</script>
Your way may work better, but so far I can't get that way to work.
Thanks again for any and all help,
jen
On Sep 1, 4:02 pm, Tobias Beer <[email protected]> wrote:
> Hi Jen,
>
> I have removed whatever twab thingy was in the code before and tested
> the following...
>
> <script label="New Tiddler">
> var allwaysTag="SomeTag";
> var p=prompt("Enter Title|TagA [[Tag B]]","").split('|');
> var title=p[0];if(!title||title=='')return;
> vartags=(allwaysTag+' '+p[1]).readBracketedList();
> store.saveTiddler(
> title,
> title,
> "<<tiddler ContactsFormTemplate>><data>{}</data>",
> config.options.txtUserName,
> new Date(),
> tags);
> story.displayTiddler(null,title);
> </script>
>
> Since I don't know what it was good for anyways... I have removed
> "config.macros.twab.importTags" and replaced it with a variable called
> allwaysTag which you could define to your liking. Unlike before, thetagsare
> now converted into an array via bracketedList(). Maybe that's
> what previously caused problems.
>
> Assuming that you have InlineJavascriptPlugin installed this should
> work for you. Please note, that - if the lines are too long - google
> may introduce arbitrary linebreaks which you would have to undo.
>
> Also, if you wanted to insert Text from a template, you can replace...
> "<<tiddler ContactsFormTemplate>><data>{}</data>"
>
> with...
> store.getTiddlerText("MyTemplateTiddler##OrItsSection"),
>
> Cheers, Tobias.
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.