how to paste with pbpaste

Hello,

Working on a Automator workflow witch does the following

Have a folder with al .tga that are compressed to .tga.gz

normaly you can do this uncompressing by typing cd and then drag the whole folder with all compressed tga.gz fiels to get the path. Then type gunzip *.gz to unpack all images.

You get my point I guess. This must be easier to do so want to make a workflow where the user only have to select the folder with al the tga.gz files

  1. want to copy the folder path - let say /Users/johndoe/Desktop/tree to the clipboard
  2. past this path behind a cd command in the terminal

so what I came up (after studying several discussions ) with is a automator workflow with apple script that has the following;

  1. folder choose by user

  2. the get path from folder and copy to clipboard (have also trouble with this part)

  3. and now the most important step, the applescript in the automator workflow;

on run {input, parameters}
	tell application "Terminal"
		do shell script "cd; pbpaste"
		do shell script "gunzip *.gz"
	end tell
	
	return input
end run

But this does not work…someone has a suggestion?

Tried several options and also looked at apple tech do shell information site but for now my brain is overheaded…and perhaps soem of you has a quick sollution.

Thanks!

Greetings

Bob

Make an Automator workflow that contains a single AppleScript:

choose folder
get quoted form of POSIX path of result

do shell script "cd " & result & "; gunzip *.gz"

Hello Bruce

It works great thanks you very much!

Bob