NISUS Archives

April 2010

NISUS@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Þorvarður Davíðsson <[log in to unmask]>
Reply To:
Date:
Fri, 30 Apr 2010 15:48:20 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (37 lines)
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

ATOM RSS1 RSS2