Skip to content

Commit a3e4272

Browse files
added bash script for mac
1 parent 4ce4f3f commit a3e4272

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

convert.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Retrieve input and output paths from arguments
4+
inputPath="$1"
5+
outputPath="$2"
6+
7+
# Check if the input file exists
8+
if [ ! -f "$inputPath" ]; then
9+
echo "Input file does not exist: $inputPath"
10+
exit 1
11+
fi
12+
13+
# Convert the Word file to PDF using textutil command
14+
textutil -convert pdf "$inputPath" -output "$outputPath"
15+
16+
# Check if the conversion was successful
17+
if [ $? -eq 0 ]; then
18+
echo "Conversion completed: $inputPath to $outputPath"
19+
else
20+
echo "Conversion failed."
21+
fi

0 commit comments

Comments
 (0)