Silent Tiddler Creation (No displayTiddler and focusTiddler steps)

8 views
Skip to first unread message

Eris of StrongHold [STRM]

unread,
Mar 19, 2009, 5:38:13 PM3/19/09
to TiddlyWikiDev
Is their a way to have a tiddler created silently? IE - Enter info at
prompt and tiddler creates, saves, and closes

<<clickify newTiddler
label:'New Project'
title:""
tag:'fETTasks'
text:{{
store.getTiddlerText("ProjectTemplate", "").
replace(/Project1/g, prompt("Enter Project Tag (No Spaces or special
characters)"))
}}
>>

Original Post:
http://groups.google.com/group/TiddlyWiki/browse_thread/thread/f6c56b9b0e7c9db2/ea63d78d50270709?q=#ea63d78d50270709

I believe FND recommended the macro route - any advise on researching
this course of action?

Eric Shulman

unread,
Mar 19, 2009, 6:13:34 PM3/19/09
to TiddlyWikiDev
> Is their a way to have a tiddler created silently? IE - Enter info at
> prompt and tiddler creates, saves, and closes
>
> <<clickify newTiddler
>  label:'New Project'
>  title:""
>  tag:'fETTasks'
>          text:{{
>              store.getTiddlerText("ProjectTemplate", "").
>   replace(/Project1/g, prompt("Enter Project Tag (No Spaces or special
> characters)"))
>          }}

Using InlineJavascriptPlugin, you can create an 'onclick' script, like
this:

<script label="New Project">
var title='NewTiddler';
var txt=store.getTiddlerText("ProjectTemplate", "").replace(/
Project1/g, prompt("Enter Project Tag (No Spaces or special
characters)"));
var who=config.options.txtUserName;
var when=new Date();
var tags='fETTasks';
var fields={};
store.saveTiddler(title,title,txt,who,when,tags,fields);
</script>

enjoy,
-e

Mike

unread,
Mar 20, 2009, 9:08:29 PM3/20/09
to TiddlyWikiDev
Awesome !!

So what is the difference in methodology between a inline script & a
macro -.-
. . . and where does each have it's place?

Just curious when I should use each - (I am planning on playing with
both)

Thanks,

Mike

Eric Shulman

unread,
Mar 20, 2009, 11:13:32 PM3/20/09
to TiddlyWikiDev
> So what is the difference in methodology between a inline script & a
> macro -.-
> . . . and where does each have it's place?

http://www.tiddlytools.com/faq.html#FAQ_ScriptsAndPlugins

In addition to the above, here's some other comparisons:

Plugins are used to extend and enhance the overall functionality
provided by the underlying TiddlyWiki application. This includes
adding new macros (e.g., <<myMacro param param param>>) and/or
modifying the standard TiddlyWiki core functions to add new abilities
to existing syntax.

In contrast, although plugins and scripts are both written with
javascript code -- and both can perform similar kinds of actions --
inline scripts are intended to be embedded directly within tiddler
content to generate *use-case specific* dynamic output and/or
'onclick' command links that can perform programmatic responses.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
Reply all
Reply to author
Forward
0 new messages