• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to do some AppleScript inside a Perl program to label duplicates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to do some AppleScript inside a Perl program to label duplicates


  • Subject: Re: How to do some AppleScript inside a Perl program to label duplicates
  • From: pete boardman <email@hidden>
  • Date: Fri, 16 Sep 2005 17:10:20 +0100

On 16 Sep 2005, at 16:52, Adam Wuellner wrote:

Gary, as usual, has excellent suggestions, but I'd like to add
one very easy solution[1] to your choices.

If you still want the filenames printed, as it seems you do, then
you'd simply add a line to the block inside this for loop that
executes the command 'osascript -e "tell application....".
Here's one way to do it:

for (@{$pair{$i}}) {
    print $$_,"\n";
    system("osascript -e 'tell application \"Finder\" to set the label
index of (POSIX file \"$$_\") to 6'");
}

Sorry this fell short, but maybe it was interesting anyway. :)

Adam - this work brilliantly for me! I was still pondering how to install some Perl modules, but this saves me the bother. No stack overflow yet...


On 16 Sep 2005, at 17:02, Doug McNutt wrote:
The CLI tool osascript allows ApleScript syntax to be compiled and executed from a command line.

Things like this appear regularly in my BBEdit worksheets.. They can also appear in a perl script if enclosed within backticks. (Well, there are sometimes the usual quoting problems.) The << operator is a UNIX "here" document.

osascript << ENDSCRIPT
tell application "Finder"
    do something
end tell
ENDSCRIPT

Efficient it is not. But it is simple.

Suits me! Fortunately, I can go and make a cup of tea while this runs...

Thanks

Pete
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How to do some AppleScript inside a Perl program to label duplicates
      • From: "Gary (Lists)" <email@hidden>
References: 
 >How to do some AppleScript inside a Perl program to label duplicates (From: pete boardman <email@hidden>)
 >Re: How to do some AppleScript inside a Perl program to label duplicates (From: "Gary (Lists)" <email@hidden>)
 >Re: How to do some AppleScript inside a Perl program to label duplicates (From: Adam Wuellner <email@hidden>)

  • Prev by Date: Re: How to do some AppleScript inside a Perl program to label duplicates
  • Next by Date: Re: """
  • Previous by thread: Re: How to do some AppleScript inside a Perl program to label duplicates
  • Next by thread: Re: How to do some AppleScript inside a Perl program to label duplicates
  • Index(es):
    • Date
    • Thread