• 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: do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script


  • Subject: Re: do shell script
  • From: "koenig.yvan" <email@hidden>
  • Date: Fri, 28 Mar 2014 08:08:00 +0100


Le 28/03/2014 à 02:54, Iurista GmbH <email@hidden> a écrit :


Am 28.03.2014 um 02.44 schrieb Nick:

try (value as string) instead.

Oops, Nick, that may be a misunderstanding (maybe my english??) What I meant is that when the value is an integer, it is NOT transported as an integer, but as a string.
But: when the value is an integer, I would like to have it stored in the plist as such: as an integer. 




2014-03-28 3:20 GMT+02:00 Iurista GmbH <email@hidden>:
Hi all

Writing to a plist file like this:

do shell script ("defaults write " & Plistfilename & " " & Key as text & " " & value)

Plistfilename and Key are string globals, value may be a string or an integer.

This works fine for text, but when the value is an integer, it does not transport that. The result in the plistfile is always a string.
"Quoted form of" does not work with integers, so how do I get my desired result.

Thanks for help
Rudolf


No hope

When you pass the command, the integer is automatically coerced as a string because the beginning IS a email@hidden
It may be shortened as :
do shell script ("defaults write " & Plistfilename & " " & Key & " " & value) 
because Key is automatically, silently, coerced as string.


If my memory is right, the system is able to recognize the numerical value when it grab datas from the plist.


Yvan KOENIG (VALLAURIS, France) vendredi 28 mars 2014 08:06:41




 _______________________________________________
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

References: 
 >do shell script (From: Iurista GmbH <email@hidden>)
 >Re: do shell script (From: Iurista GmbH <email@hidden>)

  • Prev by Date: Re: do shell script
  • Next by Date: Re: Root User
  • Previous by thread: Re: do shell script
  • Next by thread: Re: do shell script
  • Index(es):
    • Date
    • Thread