Question Time: Finder Cut and Paste, USB 1.0 vs. USB 2.0, Choppy Text, Multi-Item Clipboards

Tuesday, 2005-02-22; 02:43:00

How to get a cut and paste feature in the Finder, and other tips

(Originally posted on AppleXnet)

islander e-mailed me to ask, "I'm going to buy a new scanner for my iMac and I have USB 1.1 on it. Can I buy a scanner that has USB 2.0 and plug it into my iMac USB port without any damage to my computer?"

One of the great things about USB 2.0 is that it is backward compatible with the previous USB standard, so you'll be able to use a USB 2.0 scanner on a computer that only has USB 1.1 or even USB 1.0 ports. As you guessed, islander, using the scanner will simply be a lot slower than if you used it on a computer with USB 2.0 ports. Your new scanner should work perfectly fine, though.

You should be aware, though, that certain USB 2.0 products may not work adequately when using USB 1.1 ports on your computer. This is simply because certain products require a much faster bandwidth over which to transmit data, and if they don't have the necessary speed, they won't work as advertised. An example would be a USB webcam -- if you wanted to get realtime video from the device, you may have to settle for lower quality in order for the pictures to come through in realtime over USB 1.1. In contrast, if the same device supported USB 2.0 and you used the USB 2.0 ports on your computer, you'd be able to get higher quality video because more data could be transmitted in the same amount of time. So when in doubt, you might want to ask a salesperson or even do some tests to make sure that the device you're purchasing will work fine.

Also, something else of which you should be aware: the USB certification naming scheme can sometimes make it confusing to figure out if a product supports USB 2.0 or not. While a better naming system has been developed, you may still encounter the old naming system. So, to clear up any confusion, "Hi-Speed USB" refers to USB 2.0, while "Full-Speed USB" refers to USB 1.1. Be aware of this difference when you're purchasing USB products.

Martin, from last week fame, has another question. He asks, "Often while browsing the web I'll encounter this problem on text heavy pages such as yours, Mac Daily News, etc. . . Lines will get choppy and bunched together. [...] Any ideas?"

I always have ideas, Martin, and I know exactly what's causing the problem. Go to System Preferences, click on "Appearance", and deselect "Smooth scrolling". While this feature is very nice and gives you a visual cue as to how far you've scrolled, it often creates choppy and bunched up text in Safari. Turning off this feature should fix the problem. (It also seems to be much more prevalent in Safari, so you could try switching to another browser like Firefox, if you like smooth scrolling.)

Forum lurker JPinBK asks concisely, "Is there a way to save multiple items to the clipboard?"

The short answer is no. The long answer is that there is a way if you don't mind using third party utilities. While I personally don't use a clipboard enhancer, two highly recommended solutions are shadowClipboard and CopyPaste. Both programs allow you to have a multi-item clipboard, but shadowClipboard is a bit more powerful since it offers clipboard sharing, while CopyPaste also offers an integrated text editor. Both shadowClipboard and CopyPaste also give you a conveniently accessible status item (not a movable menu extra) in the right side of your menu bar. One of those two programs should satisfy your multi-item clipboard needs, JPinBK.

Apt prods me via e-mail to answer his question: "If I want to move a document out of Y into X I can't just cut and copy it since the filesystem doesn't support cut. [...] Can you enable 'cut' in the filesystem (possibly via a hack?)".

While the Finder doesn't support cut and paste of files, it does support copy and paste. That means you have to go through the extra step of deleting the files you originally copied, but it may be sufficient for most people. (The Finder also supports drag-and-drop moving of files, too.) However, you explicitly wanted a cut-and-paste solution, so let's see if we can solve this one via AppleScript.

We'll make two scripts, one for the cut command and one for the paste command. The cut command is simply going to save the location of any selected items to a preference file. The paste command is going to move them from their original location. To minimize damage, if you cut one file, and then cut another, the first file you cut will not be touched.

Below is the Cut AppleScript. Open up Script Editor (located inside the AppleScript folder inside your Applications folder), and paste the following text into a new script file. Save it as a script inside your home folder --> Library --> Scripts, and name it "Cut". (If the Scripts folder doesn't exist, create it.)

tell application "Finder"
set the_selection to selection
end tell
set prefs_file_location to (path to preferences folder as string) & "CutAppleScript Prefs"
delete prefs_file_location
set ref_num to open for access prefs_file_location with write permission
set eof of ref_num to 0
repeat with i in the_selection
write (i as string) to ref_num
write "\n" to ref_num
end repeat
close access ref_num

And here's the Paste AppleScript. Do the same thing as you did with the Cut AppleScript and save it as a script in your Scripts folder, with the name "Paste".

set sorry to false
tell application "Finder"
front Finder window
end tell
on error
set sorry to true
end try
if sorry is false then
set prefs_file_location to (path to preferences folder as string) & "CutAppleScript Prefs"
set ref_num to open for access prefs_file_location
set the_items to read ref_num using delimiter "\n"
repeat with next_item in the_items
tell application "Finder"
display dialog next_item
move next_item to (target of front Finder window as string)
end tell
end repeat
close access ref_num
delete prefs_file_location
display dialog "There is no target window."
end if

The AppleScripts should be pretty much self explanatory. The preference file is named "CutAppleScript Prefs" and is located in your normal preferences folder inside your home folder. If you have the Script menu extra activated (see the Question Time article from two weeks ago), you can now simply select something in the Finder, choose "Cut" from the script menu extra, navigate to the new folder, and select "Paste" from the Script menu.

That's just part of the solution, though. You probably want to be able to run these AppleScripts simply by using a command key sequence. You can't use the Keyboard and Mouse preference pane to do this, though -- you'll need to use a third-party utility. Spark, a free third-party utility, works perfectly in this case. Download it and launch it. Select "AppleScript" from the Action menu (click the gear in the toolbar), click the "File" tab, click "Choose..." and find the Cut AppleScript you saved. Then click in the "Shortcut" box and press a key combo. Then click the "Create" button. Do the same thing for the Paste AppleScript. Then just click the Play button in the toolbar to make Spark active (the window should say "Spark is Active" at the bottom). Now your Finder cut and paste is just a command sequence away!

You might not want to assign Command-X and Command-V to your new Cut and Paste AppleScripts, however, because it may hinder you from using the regular Cut and Paste operations in other applications.

Spark, showing how to create a Finder Paste shortcut

Other shortcut applications should be able to work as long as they can run AppleScripts. Just search for "hotkey" on, and you'll get a big list of other possible applications, if you don't like Spark.

Tip of the week: Built-in Word Completion

Are you looking for a particular word, but you only know it starts with "aard"? No problem. Mac OS X comes to the rescue! Simply start typing the word in your favorite text editor, and then press Option-Escape. A little menu will come up with all the possibilities to complete your word. Scroll through it, and when you find the word you want, simply press Tab and the word will replace the initial fragment that you typed! It's handy, but it seems only to work in Cocoa applications like TextEdit or Mail. (An example of a non-Cocoa application where this trick doesn't work is Microsoft Word.)

TextEdit with word completion being demonstrated

That's it for this week's Question Time. If you've got a question, e-mail it or leave a message in the forum. And tune in, as usual, on Tuesday next week for more questions and more tips. See you then!

-- Simone

Technological Supernova   Publications   Older   Newer   Post a Comment