On Dec 20, 2006, at 3:50 PM, Jan Erik Moström wrote:
Once in a while I ask myself "How can I insert current date, etc,
when I create a new document from a stationary?"
From what I understand there is no way to create a template that
includes placeholders, am I right or have I missed something all
these years?
Is there someway to do this without writing a script?
Jan,
I didn't realize you were talking about the stationery folder.
There's no reason you should not be able to include placeholders in a
piece of stationery,
You can do the same thing with the (Window -> Palette -> Stationery),
that you can do with (Window -> Palette -> Clippings).
Once you select either one of those, "insert" button in the
"Clippings", or the "open" button in the "Stationery" palette will
convert to "edit" (if you have ( 1 ) an item selected, and ( 2 ) hold
down the "option" key), at which point you can edit the document,
reveal it in the Finder, duplicate it, rename it, etc.
I duplicated "Default Worksheet Stationery", and renamed it "PHP
$_SESSION", and included the content below , saved it and restarted
BBEdit but ran into a BBBug...
Anything in the stationery folder : ~/Library/Application Support/
BBEdit/Stationery/
is supposed to open as "Untitled" but there appears to be a BBBug in
the midst. BBEdit is actually opening the the stationery as "Default
Worksheet Stationery" instead of as "Untitled", which defeats the
purpose of stationery,
So if you go to the "Stationery" palette and open "Default Worksheet
Stationery" the document that actually opens is :
~/Library/Application Support/BBEdit/Stationery/Default Worksheet
Stationery
and not an unsaved "Untitled" document. If you look at the documents
in ~/Library/Application Support/BBEdit/Stationery/ at the "Finder"
level the "stationery" checkbox is unchecked. I tried checking it for
the document I created "PHP $_SESSION" and then it disappeared from
the (File -> New With Stationery) menu, and from (Window -> Palette -
> Clippings). So apparently BBEdit is doing it's own stationery
checking instead of using the "Finder", but i is broken , at least in
version 8.5.2
Once this BBBug is fixed, using something like I tried should work
fine. All you have to do when you open a new piece of stationery, and
save it before you hit Cme-Ctrl-U to update the document with the
correct information, such as filename, etc.
I think you will find that, having a few pieces of stationery is
great, but having tons of clippings is far more flexible...
#indent#
<?php
session_start();
// +---------+---------+---------+---------+---------+---------
+---------+---------+---------+
// (1500) <[ PHP Session Initialization ]> [ BEGIN ]
// +---------+---------+---------+---------+---------+---------
+---------+---------+---------+
$_pg_filename = "#FILENAME#" ; // Version
[ #yearnum#_#monthnum#_#monthdaynum# ]
$use_local_functions = true ;
if($use_local_functions)
{
// DO NOT LOAD -> require_once ("f_00_session.php") ;
$ses_id = bh_check_session_id ( ) ;
}
else
{
require_once ("f_00_session.php") ;
if(! bh_session_ck_for_user_logout ( )) // Check to see if
the user clicked on the [Logout] button
{
$ses_id = bh_check_session_id ( ) ;
}
}
// +---------+---------+---------+---------+---------+---------
+---------+---------+---------+
// (1500) <[ PHP Session Initialization ]> [ END ]
// +---------+---------+---------+---------+---------+---------
+---------+---------+---------+
require_once ("a_application_cache.php") ;
application_start () ;
?>
Best Regards,
Bill Hernandez
Plano, Texas
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>