|
#9
| |||
| |||
| applescript droplet I made this applescript droplet earlier today to do something similar - its abit sloppy and comes with no guarantees, but it should work. on open (daFile) -- define variables set daFile to daFile as string set daPath to "" as string set badChar to {space, "'", "\"", "*", "?", "[",} -- etc set i to 1 -- check each char of daFile repeat while i <= (the length of daFile) set j to 1 set daChar to character i of daFile -- file or directory? if daChar is ":" then set daChar to "/" -- directory else if daChar is "/" then -- file set daChar to ":" end if -- test against list of bad chars repeat while j <= the number of items in badChar if daChar is (item j of badChar) then set daChar to "\\" & (item j of badChar) end if set j to j + 1 end repeat -- update daPath set daPath to daPath & daChar -- loop set i to i + 1 end repeat -- name of startup vol tell application "Finder" set startupvol to the startup disk as string end tell -- name of disk of daFile set thisDisk to the first word of daFile & ":" -- reconstruct daPath if thisDisk is startupvol then set i to 1 repeat while character i of daPath is not "/" set i to i + 1 end repeat set daPath to (characters (i) thru (the length of daPath) of daPath) as text else set daPath to "/volumes/" & daPath end if -- put daPath on clipboard set the clipboard to daPath end open hope this is of some use |
|
#10
| |||
| |||
| how did you find that out? it would have saved me writing the droplet in my lunch break... |
|
#11
| |||
| |||
| where ?... Scruffy, but where do your put the script so that you don't have to type "set prompt =" every time you start a terminal session ? I also couldn't find any "bash_local" file to edit ![]() Thanks. |
|
#12
| ||||
| ||||
| PowerPC, you put the set prompt = "" command into your ~/.login file, which is read every time you start a shell. As with most things unix, if you don't have that file, just make one ![]() This is what my (~/.login) looks like: Code: set prompt = "[helios:%~]%# "
date;uptime;ifconfig ppp0 | grep inet | awk '{print $2}';mysqladmin ping; Code: Welcome to Helios // AUTHORIZED PERSONNEL ONLY // Thu Feb 20 21:54:33 EST 2003 9:54PM up 7 days, 8:54, 3 users, load averages: 0.37, 0.07, 0.03 64.230.12.222 mysqld is alive [helios:~]%
__________________ michaelsanford.com Blog Twitter Tumblr LinkedIn iMac Aluminum 24" | MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2120 GB RAID 1, 2500 GB RAID 0 |
|
#13
| ||||
| ||||
| And here's a tip that many would find painfully obvious, but it is useful nonetheless. If you drag a file from the finder onto an open terminal window, it enters the file's full path at the prompt. So, you could type P-I-C-O-Space and drag a config file onto the window, and the command line would read: pico /path/to/configfile
__________________ - iMac G5 1.8GHZ 17" | SuperDrive | 160GB | 512MB | Airport Extreme | Bluetooth Keyboard & Mouse | Wacom Intuos II - Pentax *ist DL - JVC MiniDV Camcorder - Airport Express - iPod Nano 1gb white |
|
#14
| |||
| |||
| Thanks, Michael! Actually I put it into /etc/csh.cshrc and it works! But I forget to mention it on macosx.com. Hope it's not too late ) Thanks, again ![]() |
![]() |
| Thread Tools | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [HOWTO] - Clone a finder window. | MacLuv | HOWTO & FAQs | 2 | May 21st, 2004 10:12 PM |
| [HOWTO] - Cool Keyboard/Mouse Combos | zootbobbalu | HOWTO & FAQs | 45 | October 8th, 2003 06:36 AM |
| Starting finder window from Terminal | Ripcord | Mac OS X System & Mac Software | 2 | June 22nd, 2003 06:57 PM |
| Path Finder (ex-SNAX) - great Finder replacement | celeborn | Mac OS X System & Mac Software | 2 | January 18th, 2003 10:48 PM |