My only explanation to why this script no lnoger works is apple changed something in one of the past 2 Panther updates that will not allow this shell script to run correctly
Basicly i have a droplet script that, when i drop a finder selection of PDFs and Excel files it will:
- Make a thumbnail jpg of the pdf
- Copies the PDF to a network volume
- Moves the jpg to a network volume
- send an email with the XLS file attached to someone and the name of the file(S) moved to the network
All was fine until the recent apple updates
the problem is in the MV command for the shell script
I think it is not correcly recognizing the spaces in the path
can anyone help?
on open theList
set source_path_thumbs to "Macintosh HD:Users:jbradfield:Desktop:move to MktThumbnails:" -- Temp location to save jpg file to
display dialog "Is this an Ad?" buttons {"Yes", "No"} default button 2
if the button returned of the result is "Yes" then
set target_path_thumbs to " DEPTS:CHEMICON:Marketing:Literature:Thumbnails: ADS:" -- Target ddestination for jpg thumbnails if Ad
else
set target_path_thumbs to "DEPTS:CHEMICON:Marketing:Literature:Thumbnails:" -- Target ddestination for jpg thumbnails
end if
set target_path_pdfs to "DEPTS:CHEMICON:Marketing:Literature:PDFs:" -- Target path for the PDFs
repeat with i in theList
set theinfo to info for i
if file type of theinfo is not "XLS8" then
set chosen_file to i as alias -- (choose file) as alias -- Choose your PDF file here
set current_name to displayed name of (get info for chosen_file) -- Get the name of the PDF file
tell application "Adobe Photoshop 7.0"
set display dialogs to never
open chosen_file as PDF with options {width:3, page:1, resolution:72, mode:RGB, constrain proportions:true} -- opens the PDF as a 3" wide 72 dpi image
tell current document
flatten
save in ((source_path_thumbs & current_name) as file specification) as JPEG with options {quality:5} appending lowercase extension --saves the jpg to the temp location
close saving no
end tell
end tell
try
mount volume "smb://10.3.0.22/depts"
end try
do shell script "cp " & (quoted form of POSIX path of chosen_file) & " " & (quoted form of POSIX path of target_path_pdfs) -- copies the PDF to the PDF destination
do shell script "mv " & (quoted form of POSIX path of source_path_thumbs) & "* " & (quoted form of POSIX path of target_path_thumbs) -- moves the files from the temp folder to the Thumbnail folder
end if
end repeat
tell application "Microsoft Entourage"
make new outgoing message with properties {recipient:"rdriscoll@chemicon.com", subject:("New Literature " & current_name), attachment:(theList)}
set messID to the result
send messID
end tell
end open
on run
set p to choose file with prompt "find me a PDF file"
set x to choose file with prompt "find me a xls file"
set y to {p, x} as list
open (y as list)
end run