• 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: PDF Watermark Issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PDF Watermark Issue


  • Subject: Re: PDF Watermark Issue
  • From: Stan Cleveland <email@hidden>
  • Date: Mon, 21 May 2018 10:02:56 -0700

On May 21, 2018, at 05:18 AM, Takaaki Naganoya <email@hidden> wrote:
>
> Maybe we can call this python script from AppleScript via “do shell script”
> command.
> Can we call this with suitable parameters?

Hi Takaaki,

Maybe I'm misunderstanding your question and you already know this, but what
follows demonstrates an AS call to simple Python code with concatenated
parameters:

set desiredNum to 2
set desiredMax to 5
do shell script "python2.7 -c 'for i in range(" & desiredMax & "): print \"i
equals " & ¬
        desiredNum & "\" if i==" & desiredNum & " else None'"
-->     "None
        None
        i equals 2
        None
        None"

I'm not a Python expert, but suspect that this method won't work for Python
code that's very much more complicated. Perhaps you could store more complex
code in a Python executable file and call it using "python2.7 -m [module-name]"
as a do shell script command in AS? Am not sure—that's definitely beyond my pay
grade.

Regards,
Stan C.

 _______________________________________________
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: PDF Watermark Issue
      • From: Takaaki Naganoya <email@hidden>
References: 
 >PDF Watermark Issue (From: Takaaki Naganoya <email@hidden>)

  • Prev by Date: Re: PDF Watermark Issue
  • Next by Date: Re: Apple Mail column widths change every day
  • Previous by thread: Re: PDF Watermark Issue
  • Next by thread: Re: PDF Watermark Issue
  • Index(es):
    • Date
    • Thread