AppleScript Help w/ GREP
I'm trying to create a script that will open terminal and run a specific command that I created to get info from the system profiler. When I manually run the command in terminal it works perfectly; however when I paste it into the AppleScript editor it no longer works.
The command I want to run is:
system_profiler SPHardwareDataType SPPowerDataType SPStorageDataType SPDisplaysDataType SPMemoryDataType SPDiscBurningDataType SPCameraDataType | grep 'Cycle\|Processor\|Serial Number (system)\|Model\|Capacity\|Media\|Chipset Model\|VRAM\|Resolution\|Memory\|FaceTime\|Total Number of Cores\|Medium Type\|Type\|Speed\|Cycle\|CD-Write\|DVD-Write\|Camera’
In AppleScript Editor I have this:
tell application "Terminal"
set currentTab to do script "system_profiler SPHardwareDataType SPPowerDataType SPStorageDataType SPDisplaysDataType SPMemoryDataType SPDiscBurningDataType SPCameraDataType | grep 'Cycle\|Processor\|Serial Number (system)\|Model\|Capacity\|Media\|Chipset Model\|VRAM\|Resolution\|Memory\|FaceTime\|Total Number of Cores\|Medium Type\|Type\|Speed\|Cycle\|CD-Write\|DVD-Write\|Camera’"
activate
end tell
The error I get in AppleScript Editor is: Syntax Error: Expected “"” but found unknown token. If I run the same command without the grep portion it works OK.
Any ideas how to make this work?
Also, I want to the run: sysctl machdep.cpu.brand_string in the same script to get the full CPU info is that possible to run both one right after the other?
Macbook, Mac OS X (10.5.5), null