PDA

View Full Version : Applescript Batch Modify Troubles


screensaver400
2009-05-10, 22:14
So I'm trying to set up an Applescript to modify a file using Hexedit in Terminal. I've got the Hexedit stuff working, but I can't seem to get the batch part to work.


set input_folder to "/users/username/desktop/input/" as string

try
set the_folder_list to list folder input_folder without invisibles
repeat with x from 1 to count of the_folder_list
set the_file to input_folder & item x of the_folder_list
tell application "Terminal"
activate
do script "/opt/local/bin/hexedit " & quoted form of the_file


It continues, but that's the part I'm having trouble with. Instead of appending item x of the_folder_list, it appends each folder from the root of Macintosh HD.

I modified this script from another found online. Originally it used colons rather than slashes for the path. However, Terminal doesn't seem to like the colons.

Any ideas?

screensaver400
2009-05-10, 22:29
Got it. I needed to remove the input_folder variable and instead directly code the path in twice, with colons for the "list folder" line and with slashes for the "set the_file" line.