Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
821
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. set cmd to "~/teste.cpp ftp://user1:pass1@ftp.xoxa.com/www1/www2/www3/teste4.html" tell application "Finder" if cmd contains "ftp://" then set runtimeurl to cmd as text set AppleScript's text item delimiters to "ftp://" set filetoupload to text item 1 of runtimeurl set resto to text items 2 thru end of runtimeurl as text set AppleScript's text item delimiters to ":" set ftpuser to text item 1 of resto set resto to text items 2 thru end of resto as text set AppleScript's text item delimiters to "@" set ftppass to text item 1 of resto set resto to text items 2 thru end of resto as text set AppleScript's text item delimiters to "/" set ftpserver to text item 1 of resto set resto to text items 2 thru end of resto as text set AppleScript's text item delimiters to "/" set ftpfolder to text item 1 of resto set resto to text items 2 thru end of resto as text set filename to last text item of resto try if resto contains "/" then repeat set AppleScript's text item delimiters to "/" set ftpfolder to ftpfolder & "/" & text item 1 of resto set resto to text items 2 thru end of resto as text end repeat end if end try return ftpfolder & " " & resto set resto to text items 2 thru end of resto as text return "/echo file: " & filetoupload & " User: " & ftpuser & " Pass: " & ftppass & " Server: " & ftpserver & " Directory: " & ftpfolder & " Rest: " & resto end if end tell
  2.  
  3. result: "www1/www2/www3/teste4.html teste4.html"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement