• 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: Can we use applescript in packagemaker as postflight script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Can we use applescript in packagemaker as postflight script?


  • Subject: RE: Can we use applescript in packagemaker as postflight script?
  • From: "Manish Chaturvedi" <email@hidden>
  • Date: Fri, 16 Feb 2007 19:05:19 +0530

Hi Scott,

 

Thanks scott, this is really helpful J

 

Sorry! This question may not be for Installer-dev list but I am asking coz the script is giving different behavior when used through the installer.   

I am facing yet another problem where after writing this script, I am able to run this script from terminal, it worked well but when I am using this script in the Package maker to build the package of the application, observed that after successful installation the postflight script is changing permissions of application’s plist. The file mode got changed to no access, above all my application is not able to read the preferences form the plist file.

 

Then I tried this    

 

#!/bin/bash

PLIST="$HOME/Library/Preferences/com.Manish.myApp"

defaults write "$PLIST" LastSyncSessionTime 'none'

defaults write "$PLIST" LastSyncSessionTimeContact 'none'

chmod 777 $PLIST.plist

exit 0

 

After changing the mode of plist file to 777 I am able to set what ever I want to set and my application works fine after installation.

Am I going in right direction?

And why the postflight script is changing the file permissions?

 

Thanks and Regards,

 Manish  


From: Scott Russell [mailto:email@hidden]
Sent: Thursday, February 15, 2007 6:03 PM
To: Manish Chaturvedi
Cc: email@hidden
Subject: Re: Can we use applescript in packagemaker as postflight script?

 

Manish,

 

Alternatively, since your AppleScript is simply a series of "do shell script" commands, it should be very easy to convert to a simple shell script to use as your postflight script.

 

Something like ...

 

<CODE>

 

#!/bin/bash

PLIST="$HOME/Library/Preferences/com.Manish.myApp"

defaults write "$PLIST" LastSyncSessionTime 'none'

defaults write "$PLIST" LastSyncSessionTimeContact 'none'

 

</CODE>

 

I'm unclear why you're reading values (mycal, myaddressbook) that you're not using, but are simply replacing with 'none'?  Why read them at all?



Best wishes,

Scott

-- 

Scott Russell

 

IT Support Engineer, Distributed Support Services,

      Office of Information Technologies, University of Notre Dame

Instructor of Horn, University of Notre Dame and Saint Mary's College

Assistant Horn, South Bend Symphony Orchestra

 

205 DeBartolo Performing Arts Center

574-631-2698

email@hidden

http://www.nd.edu/~srussel2/

 



 

On Feb 15, 2007, at 1:06 AM, Dennet Menezes wrote:



Hi Manish,

As long as you are not displaying dialogs from your apple script, you could try saving the script as a .scpt file itself into your packages resources folder and calling it from your postflight shell script using the osascript tool like this

pathtoscript=$1/Contents/Resources/MyAppleScript.scpt

`osascript "$pathtoscript"`

Thanks
Dennet.



On 2/15/07 11:16 AM, "Manish Chaturvedi" <email@hidden> wrote:


Hi List,
 
I am creating package of my application where I am using an apple script that I want to run as “postflight” script in the resource folder. Script looks some thing like this.
In this script I am setting the values corresponding keys “LastSyncSessionTime” and " LastSyncSessionTimeContact" to “none” in the plist of application.
 
.   
 set myPlist to "com.apple.myApp"
set someFile to ((path to preferences as Unicode text) & myPlist & ".plist")
try
           someFile as alias
           set mycal to do shell script "defaults read " & myPlist & " LastSyncSessionTime"
           set myaddressbook to do shell script "defaults read " & myPlist & " LastSyncSessionTimeContact"
           -- edit values to calValue & addressbookValue
           set calValue to "none"
           set addressbookValue to "none"
           do shell script "defaults write " & myPlist & " LastSyncSessionTime  " & calValue
           do shell script "defaults write " & myPlist & " LastSyncSessionTimeContact " & addressbookValue
           
on error
           --display dialog "File not exists"
end try
 
I want this script to run after performing installation of application. Unfortunately this is not working when placed in the resource folder as postflight script.
I am saving the apple script as application. My Mac version is 10.4.8 and package maker’s version is 2.2.2(123).
Is there is any way to use Apple Script in package maker?  
 
Any help is useful.
 
Thanks and Regards,
Manish
 
 


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



-----------------------------------------------
Robosoft Technologies - Come home to Technology

 _______________________________________________

Do not post admin requests to the list. They will be ignored.

Installer-dev mailing list      (email@hidden)

Help/Unsubscribe/Update your Subscription:

 

This email sent to email@hidden

 

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

This email sent to email@hidden

  • Follow-Ups:
    • Re: Can we use applescript in packagemaker as postflight script?
      • From: Scott Russell <email@hidden>
References: 
 >Re: Can we use applescript in packagemaker as postflight script? (From: Scott Russell <email@hidden>)

  • Prev by Date: Re: Adding items to the Dock
  • Next by Date: Re: Can we use applescript in packagemaker as postflight script?
  • Previous by thread: Re: Can we use applescript in packagemaker as postflight script?
  • Next by thread: Re: Can we use applescript in packagemaker as postflight script?
  • Index(es):
    • Date
    • Thread