Applescript help - can't pass file reference

Hi - This is doing my head in !
I have an Automator script that encrypts a PDF and then runs an AppleScript within the Automator workflow. The result of this workflow is a filename I need within another calling Applescript.
So in the Automator workflow I have the following code:
set the new_item to (move item target_name of the temp_folder to container of the source_item)
end tell
return new_item as alias
When I view the response in the calling Applescript I see this:
"{alias \"Macintosh HD:Support:test-28 (encrypted).pdf\"}"
How do I consume this in my Applescript ?? I need to get it into a POSIX format or something I can use.
Can anyone help ??

Sorry - I posted this in the wrong forum. I have reposted in Applescript. Apologies.

Similar Messages

  • How to pass file reference to c

    Hi,
    I want to pass file reference pointer to a dll written in visual c++. How can i do that?

    What do you want to do with that reference in your C code? if you want to access it using OS File IO functions you have to be very careful! You should not mix LabVIEW nodes and OS platforms calls together. It's either one or the other.
    If you can guarantee that what you want to do is configure the Call Library Node (CLN) parameter to Adapt To Type. Then right click on the CLN and select "Create C Source Header" or something to that meaning. Save the resulting file to disk. Open it and copy the function prototype into your C/C++ file. There should be a parameter typed LVRefnum *. Now you can use the LabVIEW manager C function MgErr FRefNumToFD(LVRefNum refNum, File *fdp);
    You need to link your DLL with labview.lib in the cintools directory in order to be able to call the FRefNumToFD() function. The value in the fdp reference is the platform specific file handle, so for Windows this is a HANDLE.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Shift regsiter pass file reference problem

    Hi, I met some problem when I use shift register to store file reference, please refer to attachement.
    I want to implent the function that every hour a new file would be create, and close the old file. but the close file.vi reported error message, said error source is can't close file. other parts in the diagarm works well.
    Solved!
    Go to Solution.
    Attachments:
    chkDatalogDir_drv.vi ‏23 KB

    Are you testing this VI by itself or as a called subvi?  LabVIEW will automatically close the file reference once the top level caller stops running, even if you don't close it in code.  The ref info will remain in the shift register but it's no longer valid.  This means it passes the not a ref test but Close File can't use it.  I threw a loop around your code to keep it running(as if it were a subvi) and everything worked.
    --Using LV8.2, 8.6, 2009, 2012--

  • Address book help can't find files

    My address book help files can't be found by the help viewer. It only shows the first page. When trying clicking on the link it gives either the error message 'can't find the file' or 'something ...1001'. The same goes for Automator. I haven't checked the other applications but Image Capture which can find its files. I have also peeked with Pacifist into the apps packages and there ins't any help file in mentioned apps.
    Can anyone help or confirm?

    HI
    Control or Right Click on the Address Book Application. From the resulting menu select "Show Package Contents". You should see a folder called Contents. Look inside this folder and you should see a number of files and folders. One of them will be called Resources. Look inside this folder and you should see a plain file (ie: one with no specific icon) called AddressBook.help. On 10.6.5 it should be approx 10.6 MB in size and be version 4.0. This itself is a package and if you control or right click on the icon you should be able to select "Show Package Contents". Drill down through the resulting folder and you should see all the files and folders that make up the Help Section for address book.
    If for some reason you are missing some of these files or (more likely) don't have access to them (permissions have got messed up for some reason possibly) then either repair permissions or use Pacifist to extract AddressBook from the Installer DVD to reinstall the application again. I think it's also possible to copy over a working copy that's the same version from another mac.
    Most applications on OSX are 'standalone' and pretty much everything to do with that application will be contained 'within' the application itself. There are other ancillary files some applications use or even need - such as files placed in the User Library and Application Support folders - again it depends on the application. Your mileage as ever will vary.
    Tony

  • Help can't copy files just says screen sharing available?????

    I can do everything else but for some reason can't copy files. i've noticed that suddenly all computers have screen sharing available. i know its not the clients as it works fine on another mac. but on this one it just fails all the time. i've checked the version and they are both the same 3.2.2 but i am flumuxed. i reinstalled last week and thought it had resolved but then suddenly today it happened again. does anybody know why this is happening?

    Roboloko
    +Is this the recommended procedure from apple?+
    Not really. It's simply common troubleshooting techniques that have been used time and time again by many who've experienced problems generally. Some are recommended by Apple. Search as many of the boards as you can and you'll find these tips/recommendations mentioned countless times as well as many others. Sometimes its not something directly related to ARD that is causing ARD to have a problem.
    +did you after some test get to the conclusion that this will solve the problem?+
    No testing as such. Sometimes it solves the problems other times it does not. It's offered as something for you try before you contemplate something more drastic such as reinstalling a clean OS followed by a reinstall of ARD. Or ultimately a reformat and reinstall.
    I can see from your later post that it's not worked for you. I'm not surprised. Sometimes there are deeper underlying problems that only a reinstall or reformat and reinstall will 'cure' or possibly a solution offered by another poster? What was offered here was only meant as a possibility that might assist. As a computer user - regardless of platform - you should know this?
    Tony

  • ANT Help: Can rmic ignore circular references?

    I have two projects: m and s. One depends on the other.
    For s, I use my IDE's regular build and it's compiling just fine.
    For s, the build is also done by the IDE, but I am using Ant to rmic 3 classes.
    As far as the regular compilation goes, I have the IDE set up to ignore the circular references. But the rmic> in the ant script for the m project is complaining.
    Is it possible to ignore the circular reference for the rmic? Or maybe some other idea...
    Thanks a lot in advance
    - Eduardo

    ¡Hola, Marcos!
    If the procedures are in packages (or the same package), you can compile the package specs first, and then the package bodies.
    It's simpler if both procedures are in the same package:
    CREATE OR REPLACE PACKAGE     pk_fubar
    AS
    PROCEDURE ciclico1;
    PROCEDURE ciclico2;
    END       pk_fubar;
    SHOW ERRORS
    CREATE OR REPLACE PACKAGE BODY     pk_fubar
    AS
    PROCEDURE ciclico1
    IS
    BEGIN
            ciclico2;
    END        ciclico1
    PROCEDURE ciclico2
    IS
    BEGIN
            ciclico1;
    END        ciclico2
    END     pk_fubar
    SHOW ERRORSOr you could put just one of them in a package.
    The important thing is that you can compile a package spec and a package body separately.
    You can compile anything that references a function in a package if a valid package spec exists; the package body may be invalid, or it may not exist at all. The package body has to exist and be valid before you run the procedure that calls it, of course, but not necessarily when you compile it.

  • Install EBS on local disk from remote win 2003? Can't pass file space check

    I have a portable 250G hard disk on my poor performance win xp,I want to install EBS 12 on my portable hard disk,but I xp system's performance is poor,so I connect to a fine performance win 2003 through mstsc and I can access my 250G hard disk from remote computer win 2003;
    But when I indecate to use remote hard disk "\\tsclient\M\ebs" as my base directory,I meet some err log like below:
    RW-20012: Error: - Free disk space on system returns zero:
         probable cause - mount point does not exist.
    RW-20013: Error: - Not enough free disk space on system:
    Database ORACLE_HOME = \\tsclient\M\ebs\db\tech_st\10.2.0
    required = 3280.0
    actual = 0.0
    If I choose local disk as my base directory ,It pass the file space check;
    Can anyone meet such problem? Please help me ,thanks in advance!

    Instead of using "\\tsclient\M\ebs\db\tech_st\10.2.0" as a directory path, map this network drive as any other free drive (i.e. F:\, G:\ .. etc). You should be able to proceed with the installation then.
    If you need more details about mapping network drive, please refer to:
    Windows XP: Mapping a network drive
    http://www.microsoft.com/windowsxp/using/networking/maintain/mapdrive.mspx

  • Applescript, how can i sort files by the way they start?

    I have a folder on the Desktop called "HotFolder" This is where all the images are stored.
    They are uniquely named (either jpg's or PSD's) They begin FR10xxxxxxxxxxxx ES20 TM15 etc, Each of these refer to image type.
    On the Desktop there are folders named FR10_WK10, ES20_WK10, TM15_WK10
    Each week the folder name changes but only the digits after WK10 So the first 4 digits are consistent.
    I'm looking for an applescript to sort these files so it sorts all files beginning with FR10 to go into folder  that begins FR10 and TM15 in to folder that begins TM15.
    I've very little experience with it applescript, only good and modifying it after. So if anyone can help me out with this it would be much appreciated.
    Many Thanks

    Jacques Rioux wrote:
    MattJayC wrote:
    I get the response
    error "Finder got an error: Can’t get 1." number -1728 from 1 to «class furl»
    I think that it might not work as the folder name doesn't always start with the same ie
    Yes, the folder doesn't exist.
    Here another approach
    tell application "Finder"
        set theHotFolder to folder "HotFolder Copy"
         move (files of theHotFolder whose name starts with "BU") to (get first folder of desktop whose name starts with "Bugess2do")
         -- this moves every "TM...." and "CC...." files  to folder "TM15...."
         move (files of theHotFolder whose name starts with "TM" or name starts with "CC") to (get first folder of desktop whose name starts with "TM15")
         --- another example
         move (files of theHotFolder whose name starts with "FR") to (get first folder of desktop whose name starts with "FR10")
         move (files of theHotFolder whose name starts with "ES") to (get first folder of desktop whose name starts with "ES20")
    end tell
    Add  lines for other name.
    SUPERB WORKS LIKE A DREAM!!!!!
    Thankyou

  • HELP: Can't Pass Parameters w/Stored Procedure as Data Connection

    I'm working on using an existing employment application in PDF format, and I want the form fields to be prepopulated with the user's specific data.
    I'd like is so that when a user clicks a link (like www.mysite.com/empapp/empapp.pdf?UserID=5), a dynamic PDF document will open up and that user's data will be populated inside of the form fields by using that user's "UserID" variable/parameter that was passed in the querystring.
    I've tried a stored procedure that contains the following select statement:
    SELECT * FROM tblEmpApp WHERE UserID = @UserID
    I've also tried entering this select statement manually into the box instead of using a stored procedure without success. When I try to use the stored procedure, I receive this error:
    Stored procedure "spEmpApp" has non-optional parameters.
    How can I set the PDF doc up to populate the form fields based on that passed parameter in the querystring???
    ******************PLEASE HELP!!!******************

    had this same issue.  following works for me.
    -create a dataconnection to the db with a random query to the table.
    -just clone the dataconnection
         oDConn = xfa.sourceSet.DataConnection.clone(1);
    -change the query attribute to the stored procedure
         oDConn.resolveNode("#command").query.select.value = "exec spEmpApp 'parameter'"
    -open the cloned data connection
         oDconn.open();

  • Help-can't open file???

    have a filed saved in imovie, but when try and open it, its just says cannot open this file. When I look at it in finder, all the parts seem to be there! is there anyway I can open it which exporting all the clips? I have made a piece of music in it, which I really need in the same order but not sure how to get!
    thank you for any advise!

    Hi girliekim - welcome to the iMovie forum!
    Is the file stored on your computer's hard drive, or on an external drive?
    External drives must be formatted for Macs, not PCs.
    Open the iMovie project's package by Control-Clicking it>Show Package Contents>Shared Movies>iDVD and double click the QT.mov file.
    Does it open and play?
    Let us know what happens.

  • Logic 6.4.3 Crashed - NEED HELP - Can't Open File!!!!!!

    My Logic crashed after saving a song. When I saved my track, Logic crashed and a box appeared saying ("The application logic pro quit unexpectedly"). The backups won't open and the same error box appears, other songs project and logic open just fine. If anyone has any updates or suggest please post!
    Best,
    Chit Chat

    Same thing is happening to me. Just realized it and am going to stop using Mail for the timbering I guess.
    Also have an Exchange account.

  • Passing model reference to a page in a Popup

    Hi all,
    I have a BSP Application with MVC. In a view I want to open a new window when clicking in an input field with a JavaScript function:
    function openCatalog (inputField, inspchar) {
        adresse = "catalog.htm";
        document.formInsertMerkmal.fieldname.value = inputField;
        view = window.open(adresse, "Katalogauswahl", "width=400,height=400,left=100,top=200");
        view.focus();
    The catalog.htm is a bsp page with logic in the same application. Opening and closing this page is no problem.
    But how can I pass the reference to the model from the first view, eg. start.htm to the new page catalog.htm. I want to read data from the model and write data back to model attributes.
    Can I pass the modelreference in the url? And how do I read the model in the new window?
    In start.htm I declared the model in the page attributes and can access data from model.
    What Stepps are necessary to do the same in the new window. I don’t want to raise an event in the controller to go to a next page.
    Please help!

    Hi Raja,
    I just begin to develop with BSP. I don't understand exactly  what I must do :
    "in the method IF_BSP_APPLICATION_EVENTS~ON_START instantiate your model class and pass the instantiate model class reference to a attribute of the application class.
    now this can be referenced in the all the pages with application->applicationclassattribute for model."
    You can do an example source code, please.
    Thanks you very much for help.
    Lionel

  • Pass Finder reference between Automator and Applescript

    Hi - This is doing my head in !
    I have an Automator script that encrypts a PDF and then runs an AppleScript within the Automator workflow that does a rename on the resultant encrypted PDF. The result of this workflow is a filename I need within another calling Applescript.
    So in the Automator workflow I have the following code:
    set the new_item to (move item target_name of the temp_folder to container of the source_item)
    end tell
    return new_item as alias
    When I view the response in the calling Applescript I see this:
    "{alias "Macintosh HD:Support:test-28 (encrypted).pdf"}"
    How do I consume this in my Applescript ?? I need to get it into a POSIX format or something I can use.
    This is my test Applescript:
    http://bit.ly/fQ3s1i
    This is the Applescript within the Automator workflow:
    on run {input, parameters}
    set the result_item to item 1 of input
    set the source_item to item 2 of input
    set the target_item to result_item
    tell application "Finder"
    set the temp_folder to the container of the target_item
    copy my derivefilename(sourceitem, "pdf", "-", "") to {target_name, target_HFSpath}
    set the name of the target_item to target_name
    set the new_item to (move item target_name of the temp_folder to container of the source_item)
    end tell
    return new_item as alias
    end run
    on derivefilename(thisitem, new_extension, increment_separator, target_folder)
    -- A sub-routine used for deriving the name and path of a new file using the name of an existing file
    -- Pass in file ref in alias format, the new name extension, an increment separator, and any target directory (in alias format)
    -- Name and HFS path for new file are returned. The name is incremented if a file exists in the target location.
    -- Pass a null string for the target directory to use the item's parent directory
    -- Pass a null string for the new name extension to use the item's current name extension
    tell application "Finder"
    if target_folder is "" then
    set the target_folder to the container of this_item
    end if
    set the file_name to the name of this_item
    set file_extension to the name extension of this_item
    if the file_extension is "" then
    set the trimmed_name to the file_name
    set extension_separator to " (encrypted)"
    else
    set the trimmed_name to text 1 thru -((length of file_extension) + 2) of the file_name
    set extension_separator to " (encrypted)."
    end if
    if the new_extension is "" then
    set target_name to file_name
    set target_extension to file_extension
    else
    set target_extension to new_extension
    set target_name to (the trimmed_name & extension_separator & target_extension) as Unicode text
    end if
    if (exists document file target_name of target_folder) then
    set the name_increment to 1
    repeat
    set the new_name to (the trimmed_name & increment_separator & (name_increment as Unicode text) & extension_separator & target_extension) as Unicode text
    if not (exists document file new_name of the target_folder) then
    set the target_HFSpath to ((target_folder as Unicode text) & new_name)
    return {new_name, target_HFSpath}
    else
    set the name_increment to the name_increment + 1
    end if
    end repeat
    else
    set the target_HFSpath to ((target_folder as Unicode text) & target_name)
    return {target_name, target_HFSpath}
    end if
    end tell
    end derive_filename
    This is the workflow - I use Automator because I need that Encrypt PDF action, I can't find any other way of doing it:
    http://bit.ly/fzhbyU
    Can anyone help ??
    Message was edited by: brantwinter

    It's not entirely clear what your issue is.
    It sounds like your first script is returning:
    "{alias \"Macintosh HD:Support:test-28 (encrypted).pdf\"}"
    which is pretty easy to follow... you have a list containing one item, and that item is an alias (pointer to a file).
    What's probably confusing you is the fact that you have a list, but that's because Automator always passes lists as the parameters, so the first thing to do is extract the alias from the list:
    set my_file to item 1 of input
    which will result in:
    alias "Macintosh HD:Support:test-28 (encrypted).pdf"
    so now you have a working file reference. If you want the POSIX form of that path, just ask for it:
    set posix_path to quoted form of POSIX path of my_file
    --> '/Support/test-28 (encrypted).pdf'
    (note that I used 'quoted form of' since you have spaces (and, potentially, other non-shell safe characters) in the path.)

  • How can I pass a variable from Test Stand to CVI by reference

    Hi!
    I can't to pass numeric or boolean variable from Test Stand (for example: FileGlobals.StopFlag) into the step (CVI function).
    Function prototype: 
    void __declspec(dllexport) __cdecl PC2_WaitWhileResponceAppear(tTestData *testData, tTestError *testError, int *iStopFlag).
    When variable has bin changed I can't see this change from my function.
    CVI 2010, Test Stand 2010
    Can anybody help me?

    Hey Rombar,
    It is certainly possible to pass variables by reference; for example, if you go to <TestStand Directory>/Examples/Demo/C and open the computer.seq file, you can see one of the example sequences that uses CVI modules. If you click on one of these steps, you'll see that some of the parameters, such as the error information, is passed with pointers. This is a pass by reference.
    To help narrow this down, it'd be good for us to figure out a few things about how the code is run. First, if you go to Configure > Adapters, select the CVI adapter and choose Configure, you can see options for this adapter. Do you have it configured to run in an external instance of CVI or as an in-process call?
    Also, if you're wanting to see a change made in TestStand in your external code, this makes me think that you're wanting to run the code and then continue to execute your TestStand sequence while the code runs. How did you configure this behavior? For example, are you calling this code as a separate sequence in a new thread, or are you using another method to run this code while the sequence continues to run?
    Finally, if we could see a screenshot of how you're configuring the parameters on the TestStand step, that might be helpful as well.
    Daniel E.
    TestStand Product Support Engineer
    National Instruments

  • How can I pass a file refnum into and out of external c++ code? What type does it convert to in c++?

    I am trying to write external c++ code that will read a file already opened by Labview and therefore assigned a refnum. (Unfortunately, I definately can't use the standard Labview vis.) However I am not sure what c++ type to use in order to manage the refnum.
    All help and thoughts appreciated. Thanks,
    Joanna

    You could do ALL your file handling in C or C++ (MFC CFile for
    example) and pass Microsoft file handles into and out of LabVIEW
    instead of LabVIEW file references into and out of C. This may be an
    easier way to attack the problem.
    You could create a DLL in MSVC that exports a FileOpen function, a
    FileClose function and a FileRead and/or FileWrite Function and then
    call that DLL from place to place as required in your code.
    It would help us if you would explain what kind of data you are trying
    to read or write and what the application is. Is it binary data?
    text files? Do you need some special Win32 file system feature like
    file mapped memory? I guess what I am asking is what is your
    motivation for doing file handling in C or C++?
    Douglas De Clue
    LabVIEW developer
    [email protected]
    "Rolf" wrote in message news:...
    > A LabVIEW file refnum is an internal Magic Cookie to LabVIEW and there is no
    > way to directly extract the actual information assigned to that Magic
    > Cookie.
    > However the CIN Reference Manual describes one function which allows to
    > retrieve a lower level "File" handle and at least on Windows 32 bit and
    > LabVIEW
    > from version 5 up to and including 6.1 this "File" LabVIEW datatype directly
    > maps
    > to the Win32 API "FILE" Handle.
    >
    > The function to use is
    >
    > MgErr FRefNumToFD(LVRefNum refNum, File *fdp);
    >
    > It is declared in extcode.h or one of its dependant headers and exported
    > from "labview.lib"
    > all located in the cintools directory and you can link this lib also to a
    > normal DLL project.
    > However calling this DLL then from any other process than LabVIEW or a
    > LabVIEW
    > executable will not initialize the DLL anymore correctly.
    >
    > Your best option if you need to write in C(++) should be to use the LabVIEW
    > file manager
    > functions described on the External Code Manual (manual/lvexcode.pdf) on
    > this File handle.
    > If you need to use directly some Win32 API functions with it please note
    > that although currently
    > the "File" in the LabVIEW file manager functions matches the FILE in Windows
    > 32 bit API
    > functions this is an undocumented and hence unsupported feature. The next
    > LabVIEW version
    > may actually use a different datatype for its "File" parameter to the
    > LabVIEW file manager calls
    > and your use of assuming File == FILE may simply crash.
    >
    > Also operating on a file refnum in LabVIEW which has been accessed directly
    > with Win API
    > functions may result in strange behaviour such as the file read/write mark
    > not being updated as
    > you would maybe expect it.
    >
    > "Jo" wrote in message
    > news:50650000000800000016520000-1023576873000@exch​ange.ni.com...
    > > How can I pass a file refnum into and out of external c++ code? What
    > > type does it convert to in c++?
    > >
    > > I am trying to write external c++ code that will read a file already
    > > opened by Labview and therefore assigned a refnum. (Unfortunately, I
    > > definately can't use the standard Labview vis.) However I am not sure
    > > what c++ type to use in order to manage the refnum.
    > > All help and thoughts appreciated. Thanks,
    > > Joanna

Maybe you are looking for

  • Using 'P & X' to sort images in LRM 5

    I have just downloaded a batch of images into LRM 5 - with earlier versions in  'Library' I have been able to go quickly through all the images using P or X.  I have just found that in 5 when P or X are used, the image either shoots to the start or t

  • Deleted Files path from HardDisk ( FAT / NTFS ) in C#

    I have been trying to find a method to providing path(location) of deleted files from storage drives (Hard Disk, Removable drives etc.)  Does anyone know any classes/methods for finding deleted files, retrieving them or any tutorials or helps on the

  • Please enter sold-to party or ship-to party USING BAPI_SALESORDER_CREATEFRO

    Hello Guys, Im having a hard time in inserting the data using BAPI_SALESORDER_CREATEFROMDAT2. The return error is Please enter sold-to party or ship-to party  how can i solve this?whats the reason  behind this? The return error are :    |V4          

  • Cant find sourcesystem

    Hi all We are extracting some data from a source system but suddenly that source system is changed to client 200 to client 400 When we want to load some data  in dev we cant find old source system again what will be the solution we have assign new so

  • Error while installing NW04s

    Hi, We are currently in the process of installing a BI 7.0 (NW04s) system. Its stuck at the Install software units phase: Error: Aborted: development component 'caf/eu/es/portalcontent'/'sap.com'/'MAIN_APL70VAL_C'/'1077422'/'2', grouped by software c