<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mac Developer Tips &#187; Safari</title>
	<atom:link href="http://MacDeveloperTips.com/category/safari/feed" rel="self" type="application/rss+xml" />
	<link>http://MacDeveloperTips.com</link>
	<description>Tips, tools and code for iPhone and Mac developers.</description>
	<lastBuildDate>Tue, 29 Jun 2010 19:58:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>&#8220;FireBug Like&#8221; Tools in Safari</title>
		<link>http://MacDeveloperTips.com/defaults/firebug-like-tools-in-safari.html</link>
		<comments>http://MacDeveloperTips.com/defaults/firebug-like-tools-in-safari.html#comments</comments>
		<pubDate>Sun, 16 Mar 2008 03:53:21 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Defaults]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[web inspector]]></category>

		<guid isPermaLink="false">http://macdevelopertips.com/safari/firebug-like-tools-in-safari.html</guid>
		<description><![CDATA[Safari includes a Firebug like web-content debugging tool known as Web Inspector. Learn how to activate this tool within Safari.]]></description>
			<content:encoded><![CDATA[<p>Most all web developers, most certainly those who work with Firefox, are familiar with <a href="http://www.getfirebug.com" target="_blank">Firebug.</a> This tools nevers ceases to amaze me, the ability to change information (for example style attributes) on a webpage as your are viewing the page, is amazingly useful. Version 3.x of Safari now includes the option to enable a Firebug like debugging tool called Web Inspector&#8230;</p>
<p>You won&#8217;t find access to Web Inspector in your default installation of Safari. However, making the necessary configuration changes is as easy as running the following command from a Terminal:</p>
<pre>
defaults write com.apple.Safari WebKitDeveloperExtras -bool true</pre>
<p>If you prefer, you can use the Property List Editor to set the <font color="#800000"><em>WebKitDeveloperExtras</em></font> property in the Safari property file, which is located here: ~/Library/Preferences/com.apple.Safai.plist (use Finder to locate the file and double click to open). You&#8217;ll need to restart Safari after making the changes to enable Web Inspector.</p>
<p>To open the Web Inspector, right click and choose Inspect Element as shown in the figure below:</p>
<p><img src="http://macdevelopertips.com/wp-content/uploads/2008/03/web-inspector1.png" /></p>
<p>With Web Inspector running, you have access to a goodly amount of information. Take a look at the screenshot below which shows  content from the Google homepage.</p>
<p><img src="http://macdevelopertips.com/wp-content/uploads/2008/03/web-inspector2.png" /></p>
<p>While poking around on Web Inspector, I clicked on icon in the lower left corner (the little arrow-in-a-box) and a popup menu appeared showing options for <em><font color="#800000">Network</font></em> and <font color="#800000"><em>Console</em></font>. I selected Network and information about document and image transfers appeared (see the figure below). The Console option in this same menu resulted in a blank page appearing, so it seems I still have some exploring to do to figure what this option is all about. If you click on the icon just to the right of the <em>arrow-in-a-box</em>, the Web Inspector will be shown in a split window view versus a popup window.</p>
<p><img src="http://macdevelopertips.com/wp-content/uploads/2008/03/web-inspector3.png" /></p>
<p>I haven&#8217;t found an option for editing &#8220;on-the-fly&#8221; as in Firebug, however, Web Inspector is a good start for a built in tool and I have no doubt it will continue to evolve&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://MacDeveloperTips.com/defaults/firebug-like-tools-in-safari.html/feed</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Copy/Paste from Safari</title>
		<link>http://MacDeveloperTips.com/safari/safari-and-rtfd-file.html</link>
		<comments>http://MacDeveloperTips.com/safari/safari-and-rtfd-file.html#comments</comments>
		<pubDate>Tue, 11 Mar 2008 12:54:01 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Safari]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[rtfd]]></category>
		<category><![CDATA[textedit]]></category>

		<guid isPermaLink="false">http://macdevelopertips.com/safari/safari-and-rtfd-file.html</guid>
		<description><![CDATA[One thing I was accustomed to when working on Windows, was copying a section of a webpage and pasting the same into a Word document. Word did a pretty good job of keeping the formatting intact, including images, fonts and the like. This trick is handy when you want to print only a portion of [...]]]></description>
			<content:encoded><![CDATA[<p>One thing I was accustomed to when working on Windows, was copying a section of a webpage and pasting the same into a Word document. Word did a pretty good job of keeping the formatting intact, including images, fonts and the like. This trick is handy when you want to print only a portion of a webpage.</p>
<p>You can get there from here on a Mac, albeit with a different approach as to the internal implementation.</p>
<p><span id="more-41"></span></p>
<p>When copying a portion of a webpage in Safari, and pasting the result into a TextEdit document (both native applications on Mac OX S), formating and content are transferred to the document. Let&#8217;s look at an example. The image below is a screenshot of text that I copied from a previous post on this blog using Firefox, and pasted into TextEdit.</p>
<p><img src="http://macdevelopertips.com/wp-content/uploads/2008/03/firefox-copy.png" /></p>
<p>Now, if I copy that same information from within Safari and paste the results into TextEdit, things look altogether different, as shown in the figure below.</p>
<p><img src="http://macdevelopertips.com/wp-content/uploads/2008/03/safari-copy.png" /></p>
<p>The magic behind this is a file type known as RTFD (<a href="http://en.wikipedia.org/wiki/Rich_Text_Format_Directory" target="_blank">Rich Text Format Directory</a>).</p>
<p>If I save the file shown above with the name <font color="#800000"><em>test</em></font>, TextEdit will create an RTFD document. I am using the term <em>document</em> loosely, and you&#8217;ll see why that is momentarily.</p>
<p>In the image below are two lines from Finder, the first is an empty folder, the second is the RTFD file <font color="#800000"><em>test</em></font> that was saved from within TextEdit.</p>
<p><img src="http://macdevelopertips.com/wp-content/uploads/2008/03/finder-1.png" /></p>
<p>What&#8217;s interesting about the RTFD file format is that there is a directory created which will have a document with the formatted text (an RTF file) and other content such as such as images will also live within this directory. The reason I created the <font color="#800000"><em>test-folder</em></font> was to show the difference between how a typical directory appears in Finder (with the folder icon and directional arrow) and how an RTFD file appears as simply another file. However, from within a Terminal, if you look at the <font color="#800000"><em>test.rtfd </em></font>file, it&#8217;s obvious this entry is actually a directory. See the figure below.</p>
<p><img src="http://macdevelopertips.com/wp-content/uploads/2008/03/terminal-rtfd.png" /></p>
<p>The file <font color="#800000"><em>TXT.rtf</em></font> is the RTF file that contains the rich text formatting for the webpage that was extracted from Safari and MacPorts.jpg is the image file downloaded during the copy/paste. A partial listing of the RTF file is shown below to give you an idea of the content in this short example.</p>
<p><img src="http://macdevelopertips.com/wp-content/uploads/2008/03/rtf-1.png" /></p>
<p>You can view the contents of an RTFD file without having to resort to Terminal. From within Finder, right click on an RTFD file and choose <em>Show Package Contents</em>. This will open a new Finder window as shown below, listing the contents of the RTFD directory.</p>
<p><img src="http://macdevelopertips.com/wp-content/uploads/2008/03/finder-21.png" /></p>
<p>There it is, the secret behind copying and pasting web content on a Mac and bringing the formatting and content along for the ride.</p>
]]></content:encoded>
			<wfw:commentRss>http://MacDeveloperTips.com/safari/safari-and-rtfd-file.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
