Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Help in Applescript Mail option

$
0
0

I didn't test but don't you just need to test fileList's length/count before you loop the list…?

 

onrun

          setmyFolderto "/Users/wander5/Desktop/QuarkRescueFolder"

          set {TID, text item delimiters} to {text item delimiters, linefeed}

          tellapplication "Finder" tosetmyFilestonameoffilesof (POSIX filemyFolderasalias)

          setnewNamestoparagraphsof (do shell script "sed 's/\\(.*\\)\\((.*)\\)/\\2 \\1/' <<< " & quoted formof (myFilesastext))

          repeatwithifrom 1 tocountmyFiles

                    tellapplication "System Events" tosetnameof (firstfileoffoldermyFolderwhosenameis (item 1 ofmyFiles)) to (item 1 ofnewNames)

          endrepeat

          settext item delimiterstoTID

 

          setfileListtolist foldermyFolderwithoutinvisibles

 

          iflengthoffileList> 0 then -- Its not an empty list…

                    repeatwithtFileinfileList

 

                              setrecipientNameto "Wander5"

                              setrecipientAddressto "Wander5@yahoo.com"

                              settheSubjectto "Please check Files has been completly copied from server"

                              settheContentto "check files have been copied"

 

                              tellapplication "Mail"

 

  # # Create the message

                                        settheMessagetomakenewoutgoing messagewith properties {subject:theSubject, content:theContent, visible:true}

 

  ##Set a recipient

                                        telltheMessage

  makenewto recipientwith properties {name:recipientName, address:recipientAddress}

 

  ##Send the Message

                                                  send

 

                                        endtell

                              endtell

                    endrepeat

          endif

endrun


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>