Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7143 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi I am using a script to open a pdf for a Mac. It is the perform Apple Script and the script says:

Tell "Finder" open file "Intro.pdf" of disc "Notre Dame"

Open Selection

End Tell

I am pretty sure this is what it says, since I am writing this on my PC, can't be 100% sure. But the script was working a while back, and now it's not, just wanted to see if anyone had any ideas, or similar problems.

Thanks!

Posted

It's kind of hard to write AppleScripts on a PC. You won't have any idea whether it's correct, and no feedback. Script Editor on a Mac would tell you immediately that your syntax is incorrect. The following would work, if the file "Intro.pdf" is on the top level of the "Notre Dame" disk (not "disc").

tell application "Finder" to open file "Intro.pdf" of disk "Notre Dame"

or

tell application "Finder"

open file "Intro.pdf" of disk "Notre Dame"

end tell

You see the subtle difference, between a 1-line command (needs "to") and a nested command (separate lines). And "Finder" is an application.

Posted

I didn't write the Apple Script on the PC, I was writing my post on a PC, so since I don't have a Mac over here I couldn't read the script word for word. but it does say Disk not Disc. And I can't figure out any reason why it shouldn't be working. I am using the script that is nested.

Posted

And the commands are on separate lines? It may also be the "selection" line. Selection is the currently selected object(s) in the user interface window (what you clicked on). So you don't need or want that after you've already told the Finder to open a specific file.

This topic is 7143 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.