回答編集履歴
3
誤字修正
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
set srcFile to ("/Users/xxxxx_yyy/Desktop/code/product2022/recipient1.csv") as text
|
8
8
|
set lns to paragraphs of (read srcFile as «class utf8»)
|
9
|
-
set theAttachment to alias "
|
9
|
+
set theAttachment to alias "Users:xxxxx_yyy:Desktop:code:product2022:test.pdf" -- the attachment path
|
10
10
|
set theText to loadText("/Users/xxxxx_yyy/Desktop/code/product2022/promail2.txt")
|
11
11
|
repeat with ln in lns
|
12
12
|
|
@@ -23,7 +23,8 @@
|
|
23
23
|
先日はありがとうございました。これはテストです。", plain text content:theHonbun & "様、これからは本文です。本日は、こんにちは!テストです。先日はありがとうございました。これはテストです。"}
|
24
24
|
|
25
25
|
make new recipient with properties {email address:{address:theAddress}} at end of to recipients of theMessage
|
26
|
-
get theAttachment
|
26
|
+
make new attachment at the end of theMessage with properties {file:theAttachment}
|
27
|
+
|
27
28
|
send theMessage
|
28
29
|
|
29
30
|
end tell
|
2
誤字修正
test
CHANGED
@@ -21,10 +21,10 @@
|
|
21
21
|
|
22
22
|
set theMessage to make new outgoing message with properties {subject:theHonbun & "様、
|
23
23
|
先日はありがとうございました。これはテストです。", plain text content:theHonbun & "様、これからは本文です。本日は、こんにちは!テストです。先日はありがとうございました。これはテストです。"}
|
24
|
-
make new recipient with properties {email address:{address:theAddress}} at end of to recipients of theMessage
|
25
|
-
get theAttachment
|
26
24
|
|
25
|
+
make new recipient with properties {email address:{address:theAddress}} at end of to recipients of theMessage
|
26
|
+
get theAttachment
|
27
|
-
|
27
|
+
send theMessage
|
28
28
|
|
29
29
|
end tell
|
30
30
|
|
1
誤字修正
test
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
解決しました。
|
2
2
|
下記が最終コードです。
|
3
|
-
|
4
|
-
|
3
|
+
```
|
5
4
|
set org to AppleScript's text item delimiters -- オリジナルの区切り文字を保存
|
6
5
|
set AppleScript's text item delimiters to "," -- 区切り文字を","に変更
|
7
6
|
|
8
|
-
set srcFile to ("/Users/xxxxx_yyy/Desktop/code/recipient1.csv") as text
|
7
|
+
set srcFile to ("/Users/xxxxx_yyy/Desktop/code/product2022/recipient1.csv") as text
|
9
8
|
set lns to paragraphs of (read srcFile as «class utf8»)
|
9
|
+
set theAttachment to alias "Macintosh HD:Users:xxxxx_yyy:Desktop:code:product2022:test.pdf" -- the attachment path
|
10
|
+
set theText to loadText("/Users/xxxxx_yyy/Desktop/code/product2022/promail2.txt")
|
10
11
|
repeat with ln in lns
|
11
12
|
|
12
13
|
set theList to every text item of ln -- 区切り文字で分解してリストを作成
|
@@ -21,6 +22,8 @@
|
|
21
22
|
set theMessage to make new outgoing message with properties {subject:theHonbun & "様、
|
22
23
|
先日はありがとうございました。これはテストです。", plain text content:theHonbun & "様、これからは本文です。本日は、こんにちは!テストです。先日はありがとうございました。これはテストです。"}
|
23
24
|
make new recipient with properties {email address:{address:theAddress}} at end of to recipients of theMessage
|
25
|
+
get theAttachment
|
26
|
+
|
24
27
|
send theMessage
|
25
28
|
|
26
29
|
end tell
|
@@ -28,7 +31,7 @@
|
|
28
31
|
end repeat
|
29
32
|
|
30
33
|
set AppleScript's text item delimiters to org -- オリジナルの区切り文字に戻す
|
34
|
+
```
|
31
35
|
|
32
36
|
|
33
37
|
|
34
|
-
|