Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 7, 2008, 04:33 PM   #1
thriftinkid
macrumors regular
 
Join Date: Mar 2008
Creating URL links for FTP Uploads

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 is offline   0 Reply With Quote
Old Apr 8, 2008, 09:02 AM   #2
thriftinkid
Thread Starter
macrumors regular
 
Join Date: Mar 2008
Quote:
Originally Posted by thriftinkid View Post
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.
thriftinkid is offline   0 Reply With Quote
Old Apr 8, 2008, 09:18 AM   #3
shaggy.mac
macrumors newbie
 
Join Date: Apr 2008
Quote:
Originally Posted by thriftinkid View Post
I'm looking for it to be an applescript, but it doesn't have to be.
send me a PM
__________________
http://www.ShaggyTalk.com
Your Digital Voice Over IP Company
Coming to the iPhone as a native app
Plans starting at $14.99/month
shaggy.mac is offline   0 Reply With Quote
Old Apr 8, 2008, 09:19 AM   #4
thriftinkid
Thread Starter
macrumors regular
 
Join Date: Mar 2008
Quote:
Originally Posted by shaggy.mac View Post
send me a PM
Sorry, I'm new to writing code. What is PM?
thriftinkid is offline   0 Reply With Quote
Old Apr 8, 2008, 09:20 AM   #5
wrldwzrd89
macrumors G4
 
wrldwzrd89's Avatar
 
Join Date: Jun 2003
Location: Solon, OH
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.

Quote:
Originally Posted by shaggy.mac
send me a PM
PM, in this case, means private message.
__________________
iMac Intel (Rev H, 27"), 1TB HDD, 16GB RAM, 10.8.4
wrldwzrd89 is offline   0 Reply With Quote
Old Apr 8, 2008, 09:24 AM   #6
shaggy.mac
macrumors newbie
 
Join Date: Apr 2008
Quote:
Originally Posted by thriftinkid View Post
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)
__________________
http://www.ShaggyTalk.com
Your Digital Voice Over IP Company
Coming to the iPhone as a native app
Plans starting at $14.99/month
shaggy.mac is offline   0 Reply With Quote
Old Apr 8, 2008, 09:41 AM   #7
thriftinkid
Thread Starter
macrumors regular
 
Join Date: Mar 2008
Quote:
Originally Posted by wrldwzrd89 View Post
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.
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?
thriftinkid is offline   0 Reply With Quote
Old Apr 8, 2008, 09:45 AM   #8
wrldwzrd89
macrumors G4
 
wrldwzrd89's Avatar
 
Join Date: Jun 2003
Location: Solon, OH
Quote:
Originally Posted by thriftinkid View Post
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.
__________________
iMac Intel (Rev H, 27"), 1TB HDD, 16GB RAM, 10.8.4
wrldwzrd89 is offline   0 Reply With Quote
Old Apr 8, 2008, 10:34 AM   #9
thriftinkid
Thread Starter
macrumors regular
 
Join Date: Mar 2008
Quote:
Originally Posted by wrldwzrd89 View Post
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?
thriftinkid is offline   0 Reply With Quote
Old Apr 8, 2008, 10:46 AM   #10
wrldwzrd89
macrumors G4
 
wrldwzrd89's Avatar
 
Join Date: Jun 2003
Location: Solon, OH
Quote:
Originally Posted by thriftinkid View Post
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.
__________________
iMac Intel (Rev H, 27"), 1TB HDD, 16GB RAM, 10.8.4
wrldwzrd89 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
FTP Uploader for OSX that auto uploads when new files are added to source folder? whitedragon101 Mac Programming 4 Mar 22, 2014 05:22 AM
CSS Question - child nav links push over parent links kevindosi Web Design and Development 1 Dec 4, 2013 06:25 AM
Using a Hyphen In A URL vs. Using A URL with .us TLD steiney Web Design and Development 32 Jul 12, 2013 02:30 PM
Need help changing default ftp location for creating a file repository Diogones OS X 10.8 Mountain Lion 0 Jan 11, 2013 12:39 AM
Creating a random number within a URL using Applescript moorbull Mac Programming 1 Jul 19, 2012 08:16 AM

Forum Jump

All times are GMT -5. The time now is 11:55 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC