PDA

View Full Version : Creating URL links for FTP Uploads




thriftinkid
Apr 7, 2008, 04:33 PM
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



thriftinkid
Apr 8, 2008, 09:02 AM
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

I'm looking for it to be an applescript, but it doesn't have to be.

shaggy.mac
Apr 8, 2008, 09:18 AM
I'm looking for it to be an applescript, but it doesn't have to be.

send me a PM

thriftinkid
Apr 8, 2008, 09:19 AM
send me a PM

Sorry, I'm new to writing code. What is PM?

wrldwzrd89
Apr 8, 2008, 09:20 AM
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:


<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.

send me a PM
PM, in this case, means private message.

shaggy.mac
Apr 8, 2008, 09:24 AM
Sorry, I'm new to writing code. What is PM?

click my user name then you can send me an email or private message (PM)

thriftinkid
Apr 8, 2008, 09:41 AM
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:


<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.

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?

wrldwzrd89
Apr 8, 2008, 09:45 AM
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?
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.

thriftinkid
Apr 8, 2008, 10:34 AM
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.

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?

wrldwzrd89
Apr 8, 2008, 10:46 AM
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?
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.