Mac Filename into an URL

macaper

macrumors newbie
Original poster
Oct 3, 2014
4
0
Thanks for your fast answer

It worked just like I wanted, but is it possible to make a script that just take the addad file an make an URL of that, not the other files in the folder. I also wonder if it is possible to put the filename in the middle of the URL like below

http://www.mydomain.com/foldername/filename.jpg?login=get:get

In this URL is everything static except "filename.jpg" that I want to be the name of the file I adds to the folder.
 

macaper

macrumors newbie
Original poster
Oct 3, 2014
4
0
I saw one ing more

I didn't understand this at first, but now the files will be sent to the trash. What should I write if I want to send it to another folder instead

thanks in advance
 

kryten2

macrumors 6502a
Mar 17, 2012
999
60
Belgium
It worked just like I wanted, but is it possible to make a script that just take the addad file an make an URL of that, not the other files in the folder. I also wonder if it is possible to put the filename in the middle of the URL like below

http://www.mydomain.com/foldername/filename.jpg?login=get:get

In this URL is everything static except "filename.jpg" that I want to be the name of the file I adds to the folder.
Replace this :

Code:
tell application "System Events"
	...
end tell
with this :

Code:
tell application "System Events"
	set this_folder_name to this_folder's name
	set these_items_names to {}
	repeat with this_item in these_items
		set end of these_items_names to name of this_item
	end repeat
end tell
and this :

Code:
set end of filenamesURL to encode_text(base_URL & this_folder_name & "/" & this_item_name, false, false)
with this :

Code:
set end of filenamesURL to encode_text(base_URL & this_folder_name & "/" & this_item_name & "?login=get:get", false, false)
I didn't understand this at first, but now the files will be sent to the trash. What should I write if I want to send it to another folder instead

thanks in advance
Example :

Code:
tell application "Finder" to move these_items to folder "Done" of folder "Images" of folder "flowerimages" of folder "Desktop" of home
-- or
-- same thing as above but as an alias
tell application "Finder" to move these_items to alias "MavericksDP:Users:kryten:Desktop:flowerimages:Images:Done:"
Note : Look at the attached thumbnail for the folder structure.
 

Attachments

macaper

macrumors newbie
Original poster
Oct 3, 2014
4
0
Many thank's

I have been away for a couple of day's, but today did I try your new code and everything worked just like I wanted. Thank's a lot
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.