Opening Files

Hi I’m a newbie and I’m trying to open a file and according to this tutorial site that I’ve been looking at, it says to do it like

tell application “GraphicConverter”
open folder “Hard Disk:Users:Macker:Desktop:Site:Pics”
end tell

Another user did it like this similar to this, but I can’t get it to work. I’ve tried substituting “files” instead of “folder” but the same problem comes up.

the problem is that it’s not even recognizing it. Is there another way to do this?

–Mac-Ker

If you are looking to open a file, just use open:


tell application "GraphicConverter"
	open "Hard Disk:Users:Macker:Sites:Pics:mypic.tiff"
end tell

Also note that the Sites folder is not typically under the Desktop folder unless you’ve moved it there for a reason.

Hope this helps.

Well the Site Folder is one that I created myself. See I’m trying to get Graphic Converter to open it and automatically change the images of this file.

–Mac-Ker

I’m somewhat confused (nothing new). Do you want GC to open a folder or file(s)?

I want GC to open the file and automatically edit the images in that particular file.

Assuming that “Pics” is the name of a file, this should work.

tell application "GraphicConverter" 
         open alias "Hard Disk:Users:Macker:Desktop:Site:Pics" 
 end tell

That doesn’t seem to work either. This is so weird b/c I’m looking at it and I know it’s supposed to work. I mean how hard is it to open a file in an application. So weird.

–Mac-Ker

To rule out a bad file path, let’s see what happens with this. When the dialog opens, navigate to and select the image file that you want to open in GC.

set file_ to (choose file with prompt "Select the image file to be opened")
tell application "GraphicConverter"
	open file_
end tell

That seems to work. I guess i’m going to have to go through that route instead of asking the app to open the file and automatically edit them.

Thx Man!

–Mac-Ker

If that worked, then I guess the path to the file that you used in your earlier attempts was entered incorrectly in the script. If you run the following line, it will place the correct path of the selected file on your clipboard so that you can paste it into the script and avoid the dialog.

set the clipboard to (choose file with prompt "Select the image file to be opened") as text

I’m still unsure if you are trying to work with one file or several. :?

I finally got GraphicConverter to open the files and the weird thing is that I had to put a “:” at the end of the file path. :? But it works. Now I just have to figure out how to set the pics in the file to gray. :smiley:

—Mac-Ker