• 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: Getting Info from the Finder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting Info from the Finder


  • Subject: Re: Getting Info from the Finder
  • From: Tommy Bollman <email@hidden>
  • Date: Tue, 18 May 2010 23:17:09 +0200

Hello

I think you have done great so far. 

I have two proposals for your last pieces of code *much* shorter , which I would have tried if I was the one who wrote your script. For the lack of not coming up with a better solution at the moment I'd try using
printf via a do shell script, and trying converting to the © symbol by the iconv utility also via a shell script.

You can read through this post at macscripter: http://www.macscripter.net/viewtopic.php?id=32959 for info 
on character conversion.

I don t know if you know this, but using google site operator is great for finding stuff.
I entered this in my google bar : site:macscripter.net hexadecimal and voila: 
http://macscripter.net/viewtopic.php?id=19442


In general, I'm so glad for having the possibility to do a do shell script command, and getting access to all of the bsd commands, and even installing tools as I like it from a plethora of source trees in order to get a
job done by not having to inventing my own tool all of the time.

I'd want folder actions or / and other system wide event hooks, like on windows, with full access to the cocoa
framworks from applescript as my number one wish for applescript. 
Spotlight would also be nice.

Regards





Tommy Bollman



--------------------

No act of kindness, no matter how small, is ever wasted.
-- Aesop

On 18. mai 2010, at 13.34, Thomas Fischer wrote:

Hello,

I used the various hints and now have a a version which pretty much does what I need.
Alas, I can't copy it here as used because Mail will not accept ASCII 0, but I can use "character id 0":

set myFile to choose file
set myInfo to do shell script "mdls  -raw -name kMDItemCreator  -name kMDItemEncodingApplications " & (quoted form of (POSIX path of myFile))
set myInfo to change "[ \"\\(]*\\r[ \"\\)]*" into "" in myInfo with regexp
set myInfo to change character id 0 into ", Producer: " in myInfo
tell application "Finder" to set comment of myFile to "Creator: " & myInfo

This uses the Satimage Osax to search and replace text with regular expressions.
In case anybody wonders: I want to make the creator of TeX-based PDF files visible in the Finder window as comments.
Different creators/producers create different problems when trying to convert PDF to text, so that makes the differences easier to check.
Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users This email sent to email@hidden
  • Follow-Ups:
    • Re: Getting Info from the Finder
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Getting Info from the Finder (From: Thomas Fischer <email@hidden>)
 >Re: Getting Info from the Finder (From: Martin Michel <email@hidden>)
 >Re: Getting Info from the Finder (From: Thomas Fischer <email@hidden>)
 >Re: Getting Info from the Finder (From: Luther Fuller <email@hidden>)
 >Re: Getting Info from the Finder (From: Thomas Fischer <email@hidden>)

  • Prev by Date: Scripting InDesign CS3 print dialog box
  • Next by Date: Selecting a folder from the sidebar in a save dialog
  • Previous by thread: Re: Getting Info from the Finder
  • Next by thread: Re: Getting Info from the Finder
  • Index(es):
    • Date
    • Thread