Creating URL links for FTP Uploads

Discussion in 'Mac Programming' started by thriftinkid, Apr 7, 2008.

  1. macrumors regular

    Joined:
    Mar 24, 2008
    #1
    Hey Guys, Here's my dilema. Basically I have an applescript that takes all my quicktime movies from a designated folder and uploads them to my ftp site. I have to send out an e-mail message with a link to each quicktime I uploaded. So bascially I need to write a script that just copies and pastes the same url with the end tag changed with each quicktime name in that folder, but I don't know how to go about starting it. I new to writing any kind of code, so any advice would be of great help. Thanks guys.

    Example:

    http://www.myftpsite.com/quicktimes/quicktime1.mov
    http://www.myftpsite.com/quicktimes/quicktime2.mov
    http://www.myftpsite.com/quicktimes/quicktime3.mov
    http://www.myftpsite.com/quicktimes/quicktime4.mov
     
  2. thread starter macrumors regular

    Joined:
    Mar 24, 2008
    #2
    I'm looking for it to be an applescript, but it doesn't have to be.
     
  3. macrumors newbie

    Joined:
    Apr 8, 2008
    #3
    send me a PM
     
  4. thread starter macrumors regular

    Joined:
    Mar 24, 2008
    #4
    Sorry, I'm new to writing code. What is PM?
     
  5. macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #5
    Let's say, in the other applescript, that the current movie file is stored in a variable called currMovie. In that AppleScript, have it call your second AppleScript, and reference currMovie. For example, something like this:

    Code:
    <init code goes here>
    tell application "Mail"
    compose new email
    set to of the current email to "address@example.com"
    set body of the current email to currMovie + "your extra text goes here"
    end tell
    <cleanup code goes here>
    
    It helps a LOT to look at the application's dictionary when trying to AppleScript it. I don't know the exact commands for doing what you're trying to do, but that example code should give you a start.

    To look at the dictionary for an application, open Script Editor, then, from the File menu, choose Open Dictionary..., navigate to the application you want, and click OK.

    PM, in this case, means private message.
     
  6. macrumors newbie

    Joined:
    Apr 8, 2008
    #6
    click my user name then you can send me an email or private message (PM)
     
  7. thread starter macrumors regular

    Joined:
    Mar 24, 2008
    #7
    The list doesn't necessarily have to go directly into the e-mail message. It can be written to be made in text editor or something, and then I can have it copied and pasted into an e-mail message later. I am familiar with the dictionaries, but I don't know which one I should be looking at. The FTP program, safari, text editor?
     
  8. macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #8
    The dictionary for whichever application you are using to send the email. I assumed in that sample code that you were using Mail - the one that comes with Mac OS X.

    If you're going to be copy/pasting text into a text editor first, then you'll need the text editor's dictionary as well. Basically, you'll need to look at the dictionary for any application your script uses. If it uses more than one, you'll use more than one dictionary.
     
  9. thread starter macrumors regular

    Joined:
    Mar 24, 2008
    #9
    The other problem I'm having is that this is a list. The script above just gives the ability to change the end tag if I type it in manually right?
     
  10. macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #10
    True. However... the other script should, if it's designed right, be using the names as part of a loop. All you have to do is make a second list, if you want more than one end tag, and append the appropriate list entry each time through the loop.
     

Share This Page