On 30.04.2010, at 09:56, Þorvarður Davíðsson wrote:
> On 29.04.2010, at 15:37, Kino wrote:
>
>> To make available all your default styles in a text file opened in
>> NWP, you can paste the content of it on a new document window. (…)
Here is an improvement of my previous macro. It does not matter
whether the document is Plain Text or Rich Text File. If the document
is a Plain Text file a .rtf copy will be saved. If it is a Rich Text
File it will be *overwritten* as .rtf.
### Fetch my styles ###
# Copies everything in the open document and pastes it into a new
document thus enabling all styles in the New Nisus File
$doc = Document.active
$path = $doc.filePath
$currentName = $path.lastFilePathComponentWithoutExtension
#$extension = $path.filePathExtension
$extension = ‘rtf’
$backupName = “$currentName.$extension”
$path = User Property 'home folder path'
$path &= '/Desktop/' & $currentName
$path &= '.' & $extension
Select All
Copy
Close
New
Paste
Select All
Select Start
Save As $path