• 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: theText is empty. why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: theText is empty. why?


  • Subject: Re: theText is empty. why?
  • From: Gnarlodious <email@hidden>
  • Date: Sat, 30 Apr 2005 13:54:10 -0600

Title: Re: theText is empty. why?
To simplify:

do shell script "/Developer/Tools/DeRez -e -only 'TEXT' clip | grep '\\/\\* .* \\*\\/' | sed 's/^.*\\/\\* //;s/ \\*\\/$//' | tr -d '\\n'"


Put a text clipping in your root level called “clip” and run the above script. What happens?
I suspect your script is not even finding the clipping, since shell in Applescript uses / as the working path. Your folder action is probably sending an incomplete path to the POSIX statement.

Maybe someone else can clarify, I personally don’t use Folder Actions, they’re too flaky.

-- Gnarlie


Entity doug rogers spoke thus:

> property devToolsPath : "/Developer/Tools/" -- path to Apple Developer
> Tools
> on adding folder items to this_folder after receiving theFile
> -- from gnarlodious
> set clipPath to quoted form of POSIX path of theFile
> set cmd to devToolsPath & "DeRez -e -only 'TEXT' " & clipPath & " |
> grep '\\/\\* .* \\*\\/' | sed 's/^.*\\/\\* //;s/ \\*\\/$//' | tr -d
> '\\n'"
> set theText to do shell script cmd
> display dialog theText & "There are " & (count of items of theText) &
> " items." --zero items
> ... more script that does something with the text I want to get from
> the clipping ...
>   There is a crack in everything. That's how the light gets in.
> __________<http://home.golden.net/~samu>__________
>  _______________________________________________
 _______________________________________________
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

References: 
 >theText is empty. why? (From: doug rogers <email@hidden>)

  • Prev by Date: Safari — get selected text in text area
  • Next by Date: Re: Recovering Run Only script
  • Previous by thread: theText is empty. why?
  • Next by thread: Safari — get selected text in text area
  • Index(es):
    • Date
    • Thread