Hi all,
I require a bit of help. I am trying to create a script that allows me to choose a folder then some image files and do a shell script. With this I am trying to automate keypoint matching for panorama photography. Here is the command I’d like to execute in the terminal:
cd /path_to_folder/
/path_to_script/autopano-complete.sh -c -s 500 -p 16 -o projectname.pto /path_to_image.jpg /path_to_image.jpg /path_to_image.jpg /path_to_image.jpg
the command usage: autopano-complete.sh [options] -o panoproject.pto image1 image2 […]
I would like to execute the script in its folder. I would like to save the output file (projectname.pto) in the project folder (ie. panoramas/california) and select the images in order that i have taken. In the future I may want to change the variables (-c -s -p) and delete the keyfiles (.key) generated.
This is the output I get so far:
cd Macintosh HD:Users:sebastian:Pictures:Projects:Panoramas:MCT:images:AUGUST03b.jpgMacintosh HD:Users:sebastian:Pictures:Projects:Panoramas:MCT:images:AUGUST03c.jpgMacintosh HD:Users:sebastian:Pictures:Projects:Panoramas:MCT:images:AUGUST03a.jpg; /Applications/HuginOSX/autopano-sift-C/autopano-complete.sh -c -s 500 -p 16 -o Pano.pto Macintosh HD:Users:sebastian:Pictures:Projects:Panoramas:MCT:images:AUGUST03b.jpg Macintosh HD:Users:sebastian:Pictures:Projects:Panoramas:MCT:images:AUGUST03c.jpg Macintosh HD:Users:sebastian:Pictures:Projects:Panoramas:MCT:images:AUGUST03a.jpg
But I need this:
cd /Users/sebastian/Pictures/Projects/Panoramas/Mammoth/
/Applications/HuginOSX/autopano-sift-C/autopano-complete.sh -c -s 500 -p 16 -o mammoth.pto /Users/sebastian/Pictures/Projects/Panoramas/Mammoth/CIMG3328.jpg /Users/sebastian/Pictures/Projects/Panoramas/Mammoth/CIMG3327.jpg etc…
Here is my applescript:
--Project name
set theproject to "Pano" -- for testing only
--display dialog "Name?" default answer "pano" buttons {"Cancel", "Continue"}
--copy the result as list to {the buttonpressed, the theproject}
--set tempFolder to ""
-- select panorama folder
--set tempFolder to choose folder with prompt "Please select the Pano Folder"
--set thePanoFolder to POSIX path of tempFolder
-- select panorama images
set extensionlist to {"jpg", "jpeg", "tif"}
choose file with multiple selections allowed without invisibles --whose name extension is in extensionlist
set theFiles to result
set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to {" "}
set imageList to (text items of theFiles) & " " as Unicode text
set AppleScript's text item delimiters to ASTID
set thecommand to "cd " & theFiles & ";" & " /Applications/HuginOSX/autopano-sift-C/autopano-complete.sh -c -s 500 -p 16 -o " & theproject & ".pto" & " " & imageList
Appreciate any help,
S.