• 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: Unusual calling script problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unusual calling script problem


  • Subject: Re: Unusual calling script problem
  • From: Brian Christmas <email@hidden>
  • Date: Tue, 23 Dec 2014 12:18:24 +1100

Thanks Shane

I was  using the same property names in both AppDelegate and OddNSods, but even now that I’ve changed the OddsNSods variable names (there’s only 2 that were the same), I’m still getting an empty return.

If I’m supposed to use a different method of calling setPathToMMFolderOAS:temp then I’m at a loss on how to understand what to do. I know you’re trying to get me to understand the concept, but I’m the sort of person, once again, who learns by seeing concrete examples, and they’re few and far between on the net regarding calling one script from another.

Regards

Brian


Called from…

on setPathToMMFolder()
try
say 0
set temp to current application's OddsNSods's setPathToMMFolderOAS:{mailManagerDesktopFolderPath}
say 2
set {my mailManagerDesktopFolderPath} to temp as list
say 4
my saveThePrefs:(me)
say 5
on error errmsg number errnum
tell application "System Events" to display dialog "setPathToMMFolder AppDelegate error " & errmsg
end try
end setPathToMMFolder


Called To…

on setPathToMMFolderOAS:temp
set p to 1
try
set {mailManagerDesktopFolderPathOAS} to temp as list
set pathtodesktopOAS to path to desktop
set p to 2
if mailManagerDesktopFolderPathOAS = "New SetUp" then
say "New set up" as text —< This activates on first pass
tell application "Finder"
try
set p to 3
# This defaults to desktop
set mailManagerDesktopFolderPathOAS to folder (pathtodesktopOAS & "Mail Manager Folder" as text) as alias as text
on error
try
do shell script "mkdir -p " & quoted form of (POSIX path of ((pathtodesktopOAS & "Mail Manager Folder") as text))
end try
set p to 4
set mailManagerDesktopFolderPathOAS to folder (pathtodesktopOAS & "Mail Manager Folder" as text) as alias as text
set p to 5
end try
end tell
else
tell application "Finder"
set p to 5
try
if not (exists (folder (mailManagerDesktopFolderPathOAS as text))) then
set p to 6
set theNote to "The 'Mail Manager Folder' folder appears to be missing, it may have been moved. " & return & return & "It should have been in this location..." & return & return & mailManagerDesktopFolderPathOAS & return & return & "Please locate it."
set theNotePrefix to ""
set p to 7
repeat
set p to 8
set pathToMM to (choose folder with prompt theNotePrefix & theNote)
set p to 9
tell application "System Events" to set folderName to name of pathToMM
set p to 10
if folderName = "Mail Manager Folder" then
set p to 11
set mailManagerDesktopFolderPathOAS to pathToMM as text
set p to 12
exit repeat
else
set p to 13
set theNotePrefix to "You have not selected a folder named 'Mail Manager Folder'." & return & return & "Instead, you chose a folder named '" & folderName & "'." & return & return
end if
end repeat
end if
on error errmsg number errNum
set p to 14
try
set theNote to "The 'Mail Manager Folder' folder appears to be missing, it may have been moved. " & return & return & "Please locate it." & return & return & "NOTE: If you cannot find the 'Mail Manager Folder' folder, just select any folder, " & return & "and you'll be offered the choice of creating a new one on the desktop."
set theNotePrefix to ""
set p to 15
repeat
set p to 16
set pathToMM to (choose folder with prompt theNotePrefix & theNote)
set p to 17
tell application "System Events" to set folderName to name of pathToMM
set p to 18
if folderName = "Mail Manager Folder" then
set p to 19
set mailManagerDesktopFolderPathOAS to pathToMM as text
set p to 20
exit repeat
else
set p to 21
tell application "System Events" to display dialog "It appears that there is a problem with finding a 'Mail Manager Folder' folder." & return & return & "Do you want to create a new 'Mail Manager Folder' folder on the desktop?" buttons {"Create new folder", "Try finding again, please"}
if the button returned of the result is "Create new folder" then
tell application "Finder"
try
do shell script "mkdir -p " & quoted form of (POSIX path of ((pathtodesktopOAS & "Mail Manager Folder") as text))
end try
try
set mailManagerDesktopFolderPathOAS to folder "Mail Manager Folder" as alias as text
exit repeat
end try
end tell
end if
set theNotePrefix to "You have not selected a 'Mail Manager Folder' folder." & return & return & "Instead, you chose a folder named '" & folderName & "'." & return & return
end if
end repeat
end try
end try
end tell
end if
on error errmsg
tell application "System Events" to display dialog "setPathToMMFolder error " & errmsg & " p = " & p as text giving up after 10
end try
# This displays the full path as text
tell application "System Events" to display dialog "OddsNSods " & mailManagerDesktopFolderPathOAS as text
# This returns nothing
return {mailManagerDesktopFolderPathOAS as text}
end setPathToMMFolderOAS:






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

This email sent to email@hidden

  • Follow-Ups:
    • Re: Unusual calling script problem
      • From: Shane Stanley <email@hidden>
References: 
 >Re: Unusual calling script problem (From: Shane Stanley <email@hidden>)
 >Re: Unusual calling script problem (From: Brian Christmas <email@hidden>)
 >Re: Unusual calling script problem (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Unusual calling script problem
  • Next by Date: Re: Unusual calling script problem
  • Previous by thread: Re: Unusual calling script problem
  • Next by thread: Re: Unusual calling script problem
  • Index(es):
    • Date
    • Thread