The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Applications (http://hintsforums.macworld.com/forumdisplay.php?f=5)
-   -   how do i browse ftp in safari? (http://hintsforums.macworld.com/showthread.php?t=14816)

cudaboy_71 09-02-2003 08:03 PM

how do i browse ftp in safari?
 
as a graphic artist, i'm regularly posting pdf proofs for my clients.

for years, in ms explorer i'd just navigate to my anon-ftp site, drill down to the directory that had their pdf, right click on the file and copy the url (or directory if there were multiple files). that would let me paste the address right into an email to send them.

in safari, a url beginning in ftp:// opens up a finder window or another ftp program if one is supplied. i use transmit as my ftp app. and, its great. but, it will not let me do a simple right click to get the full path. is there a hack to make safari display ftp directories?

(FYI-explorer still does the trick in osx. but, i abhor that nastly little app)

robJ 09-02-2003 08:16 PM

Re: how do i browse ftp in safari?
 
Quote:

Originally posted by cudaboy_71 i use transmit as my ftp app. and, its great. but, it will not let me do a simple right click to get the full path. is there a hack to make safari display ftp directories?
I don't know of a hack for Safari but if you select a file in Transmit and then copy (command + C), it will place the path on the clipboard.

-- Rob

cudaboy_71 09-03-2003 03:19 PM

thanks. guess that'll hafta do. better'n opening up IE ;)

cudaboy_71 09-05-2003 11:03 AM

ugh
 
it copies my admin log/pass into the url.

still not as bad as retyping the whole thing. but, still an annoyance. any other suggestions?

robJ 09-05-2003 12:32 PM

Interested in a script?
 
Well, an AppleScript script could grab it from the clipboard and place a cleaned up version back on the clipboard. If you have a utility that allows you to assign compiled scripts to keyboard commands, it would be rather painless. Here's a basic script.

Code:

try
        set the clipboard to text ¬
                ((get offset of "@" in the clipboard) + 1) thru end of (get the clipboard)
on error e
        display dialog e
end try

-- Rob

dhayton 09-05-2003 01:25 PM

Hmmm, I'm not sure I understand what you want to produce. If I use Fetch as an ftp client, I can navigate to the .pdf file, click-hold-drag the file to my new message window in Mail.app, and it gives me the path.

For example, a message I posted here recently included two .pdf screen shots--grab1.pdf and grab2.pdf. If I select either of these (in Fetch), drag the file to a new-message window in Mail.app, the following appears where the cursor is:

<ftp://dhayton:@darwin.cc.nd.edu/www/grab2.pdf>

Is that what you are looking for?

Best,
darin

cudaboy_71 09-09-2003 01:37 PM

thanks
 
dhayton: that'd work just fine, except when i drag i get <ftp://myusername:mypassword@darwin.c.../www/grab2.pdf> (to use your example)

the final effect i'd like to produce is a link to a file or folder in an anonymous ftp that i can paste in email messages. the problem is transmit includes my user:pass@ in the ftp url.

i use transmit now in osx. but, i prefer fetch in 9...i may make the switch to fetch in X. i'd still like to have the path on my clipboard for pasting. but, a drag and drop is pretty painless too (unless i'm on my 12" laptop screen--gotta shuffle the windows around too much)

robj: i'll have to try that....even tho launching a script is more of a hassle than the drag and drop method, id still like to mess around with it.

ow...adapting hurts ;)

[edit] heh...i like how
Code:

user/pass
gets interpreted as a smiley :D

mclbruce 09-10-2003 01:27 AM

I can tell you the RBrowser Lite ftp client won't solve your problem. You could try an alternate browser like Camino.

cudaboy_71 11-23-2003 09:49 PM

Solution!
 
with mad props to macosxhints forum user Lankhmart i've massaged an applescript into providing me with a solution.

now my workflow is a) mount the anon ftp server on the desktop b) select the files i want to send links to c) switch to mail d) choose the script below from the script menu.

the script then formats a new message from me with no subject or recipeint and places the links to the selected files in the body. it works great!

one little note: my domain host has a different local path to my user folder than shows up as you would link it. so, i had to put in a find/replace routine in to strip out the extra path info.

Code:

on run
        tell application "Finder"
                set change_list to selection
        end tell
       
        set mypath to url_path(change_list)
       
        tell application "Mail"
                set fromAddress to first item of "myaddress@mydomain.com"
                set theMessage to make new outgoing message
                set visible of theMessage to true
                set content of theMessage to mypath
                activate
        end tell
       
end run

on url_path(file_list)
        tell application "Finder"
                set output_list to {}
                repeat with i from 1 to (count of file_list)
                        set current_file to (item i of file_list as alias)
                        if format of (disk of current_file) is FTP format then
                                set slash_path to POSIX path of current_file
                                set {old_delims, AppleScript's text item delimiters} to ¬
                                        {AppleScript's text item delimiters, {"/Volumes/"}}
                                set temp_list to text items of slash_path
                                set AppleScript's text item delimiters to {"ftp://"}
                                set ftp_path to temp_list as string
                                set AppleScript's text item delimiters to old_delims
                               
-- strips out any unix pathing that doesnt show up online                               
                                set theText to ftp_path
                                set ReplaceString to ""
                               
                                set OldDelims to AppleScript's text item delimiters
                                set AppleScript's text item delimiters to "any_pathing_you_need_to_remove/"
                                set newText to text items of theText
                                set AppleScript's text item delimiters to ReplaceString
                                set finalText to newText as text
                                set AppleScript's text item delimiters to OldDelims
                                finalText
                               
                                copy finalText to the end of output_list
                        else
                                --do nothing if the selection does not include FTP server files
                        end if
                end repeat
        end tell
        set {old_delims, AppleScript's text item delimiters} to ¬
                {AppleScript's text item delimiters, {return & return}}
        set output_string to output_list as string
        set AppleScript's text item delimiters to old_delims
        return output_string
end url_path



All times are GMT -5. The time now is 06:09 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.