I am trying to create a script that will allow me to create a folder based on the name of the file and place the file in that folder. I have found one that is created to work on the desktop folder but have not been able to get it to function on the external drive. If anyone could help me out that would be great.
The name of the external drive is Video 1 and is connected via USB if that matters.
Here is what I have for the script so far.
on adding folder items to this_folder after receiving added_items
tell application "Finder"
set new_folder to "Video 1"
set copied_folders to make new folder at new_folder with properties {name:"New folders"}
repeat with aItem in added_items
set x to kind of aItem
if x is not "Folder" then
set y to name of aItem
set AppleScript's text item delimiters to "."
set filename to first text item of y
set AppleScript's text item delimiters to ""
set newplace to make new folder at copied_folders with properties {name:filename}
move aItem to newplace
end if
end repeat
end tell
end adding folder items to
any help would be greatly appreciated. I think the item I am missing is how to specify the right location for the external device.
The name of the external drive is Video 1 and is connected via USB if that matters.
Here is what I have for the script so far.
on adding folder items to this_folder after receiving added_items
tell application "Finder"
set new_folder to "Video 1"
set copied_folders to make new folder at new_folder with properties {name:"New folders"}
repeat with aItem in added_items
set x to kind of aItem
if x is not "Folder" then
set y to name of aItem
set AppleScript's text item delimiters to "."
set filename to first text item of y
set AppleScript's text item delimiters to ""
set newplace to make new folder at copied_folders with properties {name:filename}
move aItem to newplace
end if
end repeat
end tell
end adding folder items to
any help would be greatly appreciated. I think the item I am missing is how to specify the right location for the external device.