Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

easier way to remove formatting

I've searched and seen a few answers on this, but none of them are what I'm looking for.


In Word, when you import a text, you can do Ctr+a to select the whole text, then both Opt+Space and after that Shift+Fn+Cmd+F9 which will totally strip everything out of the text, including hyperlinks.


In Libreoffice, you can just chose the text then select 'Default Formatting', even easier.


How to do it in Pages09? From reading the other threads in this forum, I've found that you can:


Paste & Match Style (Op+Shft+Cmd+v) which will give you a basic text. Another option seems to be to do an ordinary paste (Cmd+v) then double click 'Free Form' and click Character Styles 'None'.


Then you need to open the inspector, chose Links and uncheck 'Enable Hyperlinks' and possibly check 'Disable all hyperlinks' (this checkbox seems to be redundant given the first one, anyone know why its there?).


Phew...talk about a rigamarole....well, does anyone know an easier way of doing it? Back in 2008, someone suggested using Automotor to record the moves. Never tried using that so far, though I understand its just a macro recorder of some sort. Surely, come 2011, there is a simpler way to achieve this basic function?


So, how to import a text and clear ALL formatting (incl' hyperlinks) the easy way? Anyone??

MacBook Pro 2.53GHz Intel Core 2 Duo, Mac OS X (10.6.8), 4GB 1067 MHz DDR3

Posted on Jul 20, 2011 5:58 AM

Reply
Question marked as Best reply

Posted on Jul 20, 2011 7:09 AM

You may use my good old huge script.


--{code}

set the clipboard to the clipboard as text

--{code}


step 1 : select all the document's contents

step 2 : press cmd + x to move the contents from the document to the clipboard

step 3 : run the script

step 4 : paste in the document.


You may also use this new one which does the complete trick in a single call.


--{code}

--[SCRIPT remove_formatting]

(*

Enregistrer le script en tant que Script : remove_formatting.scpt

déplacer le fichier ainsi créé dans le dossier

<VolumeDeDĂ©marrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:

Il vous faudra peut-ĂȘtre crĂ©er le dossier Numbers et peut-ĂȘtre mĂȘme le dossier Applications.



Aller au menu Scripts , choisir Numbers puis choisir “remove_formatting”

It will save it as a dumb text file which it will open immediately.


--=====


L’aide du Finder explique:

L’Utilitaire AppleScript permet d’activer le Menu des scripts :

Ouvrez l’Utilitaire AppleScript situĂ© dans le dossier Applications/AppleScript.

Cochez la case “Afficher le menu des scripts dans la barre de menus”.

Sous 10.6.x,

aller dans le panneau “GĂ©nĂ©ral” du dialogue PrĂ©fĂ©rences de l’Éditeur Applescript

puis cocher la case “Afficher le menu des scripts dans la barre des menus”.


--=====


Save the script as a Script: remove_formatting.scpt


Move the newly created file into the folder:

<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:

Maybe you would have to create the folder Numbers and even the folder Applications by yourself.


Open a Pages document at front.

Go to the Scripts Menu, choose Numbers, then choose “remove_formatting”

It will save it as a dumb text file which it will open immediately.


--=====


The Finder’s Help explains:

To make the Script menu appear:

Open the AppleScript utility located in Applications/AppleScript.

Select the “Show Script Menu in menu bar” checkbox.

Under 10.6.x,

go to the General panel of AppleScript Editor’s Preferences dialog box

and check the “Show Script menu in menu bar” option.


--=====


Yvan KOENIG (VALLAURIS, France)

2011/07/20

*)

--=====


on run

set temp_path to (path to temporary items from user domain as text) & (do shell script "date +_%Y%m%d_%H%M%S.txt")


tell application "Pages"

save document 1 as "SLDocumentTypePlainText" in temp_path


openfiletemp_path

end tell

end run


--=====

--[/SCRIPT]

--{code}


Yvan KOENIG (VALLAURIS, France) mercredi 20 juillet 2011 16:09:10

iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8

Please : Search for questions similar to your own before submitting them to the community


To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

17 replies
Question marked as Best reply

Jul 20, 2011 7:09 AM in response to softwater

You may use my good old huge script.


--{code}

set the clipboard to the clipboard as text

--{code}


step 1 : select all the document's contents

step 2 : press cmd + x to move the contents from the document to the clipboard

step 3 : run the script

step 4 : paste in the document.


You may also use this new one which does the complete trick in a single call.


--{code}

--[SCRIPT remove_formatting]

(*

Enregistrer le script en tant que Script : remove_formatting.scpt

déplacer le fichier ainsi créé dans le dossier

<VolumeDeDĂ©marrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:

Il vous faudra peut-ĂȘtre crĂ©er le dossier Numbers et peut-ĂȘtre mĂȘme le dossier Applications.



Aller au menu Scripts , choisir Numbers puis choisir “remove_formatting”

It will save it as a dumb text file which it will open immediately.


--=====


L’aide du Finder explique:

L’Utilitaire AppleScript permet d’activer le Menu des scripts :

Ouvrez l’Utilitaire AppleScript situĂ© dans le dossier Applications/AppleScript.

Cochez la case “Afficher le menu des scripts dans la barre de menus”.

Sous 10.6.x,

aller dans le panneau “GĂ©nĂ©ral” du dialogue PrĂ©fĂ©rences de l’Éditeur Applescript

puis cocher la case “Afficher le menu des scripts dans la barre des menus”.


--=====


Save the script as a Script: remove_formatting.scpt


Move the newly created file into the folder:

<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:

Maybe you would have to create the folder Numbers and even the folder Applications by yourself.


Open a Pages document at front.

Go to the Scripts Menu, choose Numbers, then choose “remove_formatting”

It will save it as a dumb text file which it will open immediately.


--=====


The Finder’s Help explains:

To make the Script menu appear:

Open the AppleScript utility located in Applications/AppleScript.

Select the “Show Script Menu in menu bar” checkbox.

Under 10.6.x,

go to the General panel of AppleScript Editor’s Preferences dialog box

and check the “Show Script menu in menu bar” option.


--=====


Yvan KOENIG (VALLAURIS, France)

2011/07/20

*)

--=====


on run

set temp_path to (path to temporary items from user domain as text) & (do shell script "date +_%Y%m%d_%H%M%S.txt")


tell application "Pages"

save document 1 as "SLDocumentTypePlainText" in temp_path


openfiletemp_path

end tell

end run


--=====

--[/SCRIPT]

--{code}


Yvan KOENIG (VALLAURIS, France) mercredi 20 juillet 2011 16:09:10

iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8

Please : Search for questions similar to your own before submitting them to the community


To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

Jul 20, 2011 8:09 AM in response to softwater

Thank you


(1) for the feedback

(2) for the correction of the typo related to my first name 😉


To be honest, I was surprised by the efficiency of the script.

I tested it with my good old test doc with 12131 words, 58 pages and I had no time to breathe before getting the bare text on the screen.


Yvan KOENIG (VALLAURIS, France) mercredi 20 juillet 2011 17:05:20

iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8

Please : Search for questions similar to your own before submitting them to the community


To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

May 24, 2013 12:36 AM in response to softwater

In response to PeteMacca, yes, it is a basic feature included in the product.


For future reference, the simple answer is Pages, File, Export, Plain Text, Next...

User uploaded file

Save As (and if you wish, select a location to save the file, and rename the document from the default, Untitled.txt) Export.


User uploaded file

Voila.

Plain text.

No hyperlinks.

The font even looks like 8-bit dot-matrix!


Message was edited by: kostby

May 24, 2013 1:10 AM in response to kostby

Oh, but that's not AT ALL what I asked. 😁


I know how to export a doc as plain text. We're talking about IMPORTING text which is rich text in the clipboard but pasting it as plain text in Pages.


Well, since asking this question a couple of years back, I've developed my own simpler answer to the one Yvan gave.


set the clipboard to «class ktxt» of ((the clipboardastext) as record)


Save the above line as an applescript service in Automator or as a normal AppleScript and use FastScripts to simply click the script in the script menu after copying and before pasting.


If you use Automator you can make it a service and asssign it a hotkey. If you use FastScripts you can assign it a global shortcut key, too. 🙂


Works across all your apps (i.e., system wide) and is nice and simple.



May 25, 2013 3:59 AM in response to softwater

Thanks guys. I have been using document markup and WP for 30 years, and I know there are a number of ways to export and strip format from text.


Point is I use Apple products that I expect to have useful and intuitive features. It's not uncommon to cut/paste from multiple sources and so i expect it to be easy. So if I paste some text into a paragraph, by default I think it shoud just merge in with the formatting of the paragraph - dont you think that would be a sensible default. If I want bright orange large scale font matching the source text, make that the next option and make it easy to action.


Barry, I will pass on this sugestion to feedback - thanks.


I find myself using the basic googledocs word processor more and more - its basic, it lacks a few really useful features but its productive.


Have to say - Macbook Pro Retina 13" is the nicest laptop I've ever used 🙂

May 25, 2013 4:48 AM in response to PeteMacca

Hi Pete,


So if I paste some text into a paragraph, by default I think it shoud just merge in with the formatting of the paragraph


Yes. Edit > Paste and Match Style:


User uploaded file

Does that also answer your point about cut/paste from multiple sources?

Your second question (that did not appear in your first question):


make that the next option and make it easy to action.


What is not happening?


Regards,

Ian.

May 25, 2013 10:38 PM in response to softwater

Hi Ian,


Two issues 1) I cant figure out the difference betwen paste and Paste matching style 2) That would only work before I have pasted.


1) I have a fresh pages document open with only the text "blah blah blah". I selected "This helped meRe: easier way to remove formatting" from Softwater's star entry a couple of posts above. When I "Command+v" or Edit>Paste or "shift+option+command+v" or Edit>Paste and Match Style" I get the same result. Maybe I have a bug, but would be interested to see if you get the same result?

Using latest pages 4.3 and Safari on latest OSX 10.3

PS - Further testing - I can get some web page text to cut/Paste-and-Match OK, but the 1st example I used here doesnt work?? Textedit strips the text out OK.


2) If I have already pasted, or are trying to fix a document with inconsistent formatting, there is no way other than a painful extract to plain test editor and repaste back. Try that with a document containing 10's or 100's of poorly constructed paragraphs - as in the situation where you are finalising a tender with many different authors, or with people's CV. Word seems to work better at forcing a paragraph format. Googledocs provides a single button to remove formatting in ablock of text.


Cheers, Pete.

May 26, 2013 1:20 AM in response to PeteMacca

Hi Pete,


I had a play with your suggestions. Paste and Match Style works only when you insert into the style you want (plain). If you Paste (without Match Style) the source format is inserted and you have changed the style; further inserts will follow that style.


I started with a bank document (my default font Times New Roman) and typed this:

User uploaded file

After playing (oops, different zoom. Don't pay attention to that):


User uploaded file

Paste and Match Style forced the inserted text to Times New Roman. The final Paste (without Match Style) has set the font to the copied text and further paragraphs will follow that.


It seems that Kostby's solution is the way to go. Export as Plain Text, open the text document, Edit > Select All (command a) then Edit > Copy (command c).

Edit > Paste (command v) into a blank Pages document.


My playing with your ideas has demonstrated the philosophy of Mac: it remembers, it remembers, it remembers. And it does.


Pity about the lack of that splendid "Remove Formatting" command in Word.


Regards,

Ian.

May 26, 2013 5:58 AM in response to Yellowbox

It seems that Kostby's solution is the way to go. Export as Plain Text, open the text document, Edit > Select All (command a) then Edit > Copy (command c).

Edit > Paste (command v) into a blank Pages document.




Well, only if you like hard work... 😉


Just create a service and a shortcut with the command I gave you above. If you're not sure how to do that, I made you a video.


The video starts with a demonstration of what I'm talking about, and then shows you how to set it up. The video uses TextEdit as an example but it works in Pages and indeed any other app if you set it up as shown:


http://www.youtube.com/watch?v=7U-MrstWRJA&feature=youtube_gdata

May 27, 2013 1:31 AM in response to softwater

Ian, I can now see that in the two cases that the font is matched to the paragrah - just that the hyperlink is still there 😟


Softwater - followed your video, setup and working OK - thanks - I can see automator getting a workout 🙂


So basically now down to a 4 step operation to strip formatting from a paragraph:


1) Select paragraph (triple click anywhere in a paragraph)

2) ⌘x

3) ⌘'

4) ⌘v


I'm betting there is a way to do automate steps 2-4 in one easy "plainTxt" blast 🙂


I tried setting up plainTxtParagraph as below - works except I get a double up of the section selected.


-- Press ⌘X

delay 0.064039

set timeoutSeconds to 2.0

set uiScript to "keystroke \"x\" using command down"

my doWithTimeout(uiScript, timeoutSeconds)


-- Press ⌘'

delay 0.055891

set timeoutSeconds to 2.0

set uiScript to "keystroke \"'\" using command down"

my doWithTimeout(uiScript, timeoutSeconds)


-- Press ⌘V

delay 0.111988

set timeoutSeconds to 2.0

set uiScript to "keystroke \"v\" using command down"

my doWithTimeout(uiScript, timeoutSeconds)


on doWithTimeout(uiScript, timeoutSeconds)

set endDate to (current date) + timeoutSeconds

repeat

try

run script "tell application \"System Events\"

" & uiScript & "

end tell"

exit repeat

on error errorMessage

if ((current date) > endDate) then

error "Can not " & uiScript

end if

end try

end repeat

end doWithTimeout

easier way to remove formatting

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.